Management

management

Neptune API allows you to manage administration programmatically including:
  • adding and removing members
  • creating and deleting projects
  • listing projects, and 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.
It is strongly recommended to use 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 project you created.

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. It has to be contained 1-10 upper case 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') - level of visibility you want your project to have.
Can be set to:
  • 'pub': for public projects
  • 'priv': for private 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.
It is strongly recommended to use NEPTUNE_API_TOKEN environment variable rather than placing your API token in plain text in your source code.

Returns

strwith the name of the new project you created.

Examples

1
from neptune import management
2
management.create_project(name='awesome-team/amazing-project',
3
key='AMA',
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.
It is strongly recommended to use NEPTUNE_API_TOKEN environment variable rather than placing your API token in plain text in your source code.

Returns

strwith the name of the new project you created.

Examples

1
from neptune import management
2
management.delete_project(name='awesome-team/amazing-project')
Copied!

.add_project_member

Adds username 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.
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.
It is strongly recommended to use 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='awesome-team/amazing-project',
3
username='johny',
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='awesome-team/amazing-project')
Copied!

.remove_project_member

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.
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='awesome-team/amazing-project',
3
username='johny')
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='awesome-team')
Copied!
Last modified 1mo ago