Create and delete projects via API#
You can do various project administration tasks with the management API.
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 the management
package and use the create_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
workspace
parameter. 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-Project
and cv-project
will be treated as the same.
You must supply the workspace and project name; everything else is optional.
If you omit the key
argument, 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:
Listing projects you have access to#
To get a list of all projects you have access to, import the management
package and use the get_project_list()
function:
- 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:
Deleting a project#
Before you start: Obtain the name of the project and the workspace where it's located.
To delete a project, import the management
package and use the delete_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
workspace
parameter. For example,project="ml-team/named-entity-recognition"
Expected output
If there is no error message, the project was deleted successfully.