Management
How to manage projects and members through the Neptune API
The management module lets you perform administration tasks through the Neptune API, including:
  • adding and removing members
  • creating and deleting projects
  • listing projects
  • listing members of projects and workspaces

.get_project_list

Get a list of projects you have access to.
Parameters
api_token
(str, optional, defaults to None) - User’s API token. If None, the value of NEPTUNE_API_TOKEN environment variable will be taken.
We strongly recommended using the NEPTUNE_API_TOKEN environment variable rather than placing your API token in plain text in your source code.

Returns

List[str]: list of project names with the format WORKSPACE_NAME/PROJECT_NAME.

Examples

1
from neptune import management
2
management.get_project_list()
Copied!

.create_project

Creates a new project in your Neptune workspace.
Parameters
name
(str) - The name of the project in Neptune in the format WORKSPACE/PROJECT. If workspace argument was set, it should only contain PROJECT instead of WORKSPACE/PROJECT.
key
(str) - Project identifier. Must contain 1-10 uppercase letters or numbers. For example, GOOD5
workspace
(str, optional) - Name of your Neptune workspace. If you specify it, change the format of the name argument to PROJECT instead of WORKSPACE/PROJECT. If None it will be parsed from the name argument.
visibility
(str, management.ProjectVisibility, optional, defaults to 'priv') - The level of visibility to set for the project.
Can be set to:
  • 'priv': for private projects
  • 'workspace': for projects accessible to all workspace members
  • 'pub': for public projects
If None it will be set to 'priv'.
description
(str, optional) - Project description. If None, it will be left empty.
api_token
(str, optional, defaults to None) - User’s API token. If None, the value of NEPTUNE_API_TOKEN environment variable will be taken.
We strongly recommended using the NEPTUNE_API_TOKEN environment variable rather than placing your API token in plain text in your source code.

Returns

str with the name of the new project you created.

Examples

1
from neptune import management
2
management.create_project(name="research-team/sample-project",
3
key="SAM",
4
visibility="pub")
Copied!

.delete_project

Deletes a project from your Neptune workspace.
Parameters
name
(str) - The name of the project in Neptune in the format WORKSPACE/PROJECT. If workspace argument was set, it should only contain PROJECT instead of WORKSPACE/PROJECT.
workspace
(str, optional) - Name of your Neptune workspace. If you specify it, change the format of the name argument to PROJECT instead of WORKSPACE/PROJECT. If None it will be parsed from the name argument.
api_token
(str, optional, defaults to None) - User’s API token. If None, the value of NEPTUNE_API_TOKEN environment variable will be taken.
We strongly recommend using the NEPTUNE_API_TOKEN environment variable rather than placing your API token in plain text in your source code.

Examples

1
from neptune import management
2
management.delete_project(name="research-team/sample-project")
Copied!

.add_project_member

Adds a user to a project.
Parameters
name
(str) - The name of the project in Neptune in the format WORKSPACE/PROJECT. If workspace argument was set, it should only contain PROJECT instead of WORKSPACE/PROJECT.
username
(str) - name of the user you want to add to the project.
role
(str, management.MemberRole) - level of permissions the user should have in a project.
Can be set to:
  • viewer': can only view project content and members
  • 'contributor': can view and edit project content and only view members
  • 'owner': can view and edit project content and members
For more information, see docs for User roles in a project.
workspace
(str, optional) - Name of your Neptune workspace. If you specify it, change the format of the name argument to PROJECT instead of WORKSPACE/PROJECT. If None it will be parsed from the name argument.
api_token
(str, optional, defaults to None) - User’s API token. If None, the value of NEPTUNE_API_TOKEN environment variable will be taken.
We strongly recommend using NEPTUNE_API_TOKEN environment variable rather than placing your API token in plain text in your source code.

Examples

1
from neptune import management
2
management.add_project_member(name="research-team/sample-project",
3
username="johnny",
4
role="contributor")
Copied!

.get_project_member_list

Get a list of members for a project.
Parameters
name
(str) - The name of the project in Neptune in the format WORKSPACE/PROJECT. If workspace argument was set, it should only contain PROJECT instead of WORKSPACE/PROJECT.
workspace
(str, optional) - Name of your Neptune workspace. If you specify it, change the format of the name argument to PROJECT instead of WORKSPACE/PROJECT. If None it will be parsed from the name argument.
api_token
(str, optional) - Name of your Neptune workspace. If you specify it, change the format of the name argument to PROJECT instead of WORKSPACE/PROJECT. If None it will be parsed from the name argument.

Returns

Dict[str, str] with usernames as keys and MemberRoles ('owner', 'member', 'viewer') as values.

Examples

1
from neptune import management
2
management.get_project_member_list(name="research-team/sample-project")
Copied!

.remove_project_member

Removes a user from your project members.
Parameters
name
(str) - The name of the project in Neptune in the format WORKSPACE/PROJECT. If workspace argument was set, it should only contain PROJECT instead of WORKSPACE/PROJECT.
username
(str) - name of the user you want to remove from the project.
workspace
(str, optional) - Name of your Neptune workspace. If you specify it, change the format of the name argument to PROJECT instead of WORKSPACE/PROJECT. If None it will be parsed from the name argument.
api_token
(str, optional) - Name of your Neptune workspace. If you specify it, change the format of the name argument to PROJECT instead of WORKSPACE/PROJECT. If None it will be parsed from the name argument.

Examples

1
from neptune import management
2
management.remove_project_member(name="research-team/sample-project",
3
username="johnny")
Copied!

.get_workspace_member_list

Get a list of members of a workspace.
Parameters
name
(str) - The name of the project in Neptune in the format WORKSPACE/PROJECT. If workspace argument was set, it should only contain PROJECT instead of WORKSPACE/PROJECT.
api_token
(str, optional) - Name of your Neptune workspace. If you specify it, change the format of the name argument to PROJECT instead of WORKSPACE/PROJECT. If None it will be parsed from the name argument.

Returns

Dict[str, str] with usernames as keys and MemberRoles ('owner', 'member', 'viewer') as values.

Examples

1
from neptune import management
2
management.get_workspace_member_list(name="research-team")
Copied!