Creating and deleting projects via API
Examples of managing projects through the Neptune API.
You can do various project administration tasks with themanagementAPI.
In this basic guide, we show you how to:
- Create a new project
- List the projects you have access to
- Delete a project
Creating a project
Before you start:
- Obtain the name of the workspace where the project should be created.
- (If your workspace has a project limit) Ensure that your projects quota isn't full. If you're at the limit, upgrade your subscription or archive another project first.
To create a new project, import themanagementpackage and use thecreate_project()function:
from neptune import management
management.create_project(
name="named-entity-recognition", # (1)!
key="NER",
workspace="ml-team",
visibility="workspace", # (2)!
description="Team-wide NER project for important conference",
)
- You can also prefix the workspace name here and omit the
workspaceparameter. For example,name="ml-team/named-entity-recognition" - Neptune makes the project private by default. Note that private projects are not available on plans without project-level access control, so in that case you need to set the value to
"workspace"or"pub".
The project name is case-insensitive. For example,CV-Projectandcv-projectwill be treated as the same.
You must supply the workspace and project name; everything else is optional.
If you omit thekeyargument, Neptune generates a project key for you based on the project name.
Expected output
If the project was created successfully, Neptune returns the full name of the new project:
'ml-team/named-entity-recognition'
Listing projects you have access to
To get a list of all projects you have access to, import themanagementpackage and use theget_project_list()function:
from neptune import management
management.get_project_list() # (1)!
- We recommend saving your API token as an environment variable . If needed, you can pass it as an argument here:
management.get_project_list(api_token="h0dHBzOi8aHR0cHM6Lkc...")
Expected output
A list of project names that the account associated with the API token has access to. For example:
['jackie/sandbox', 'jackie/thesis-project', 'ml-team/classification', 'ml-team/test']
Deleting a project
Before you start:Obtain the name of the project and the workspace where it's located.
To delete a project, import themanagementpackage and use thedelete_project()function:
from neptune import management
management.delete_project(
project="named-entity-recognition", # (1)!
workspace="ml-team",
)
- You can also prefix the workspace name here and omit the
workspaceparameter. For example,project="ml-team/named-entity-recognition"
Expected output
If there is no error message, the project was deleted successfully.
Related
- Create a Neptune project
- Create and delete projects via API
- Invite people to your workspace or project
- Trash and delete data
- API reference ≫ management
This page is originally sourced from the legacy docs.