Set Neptune credentials#
Neptune generally needs two things in order to send the metadata to the correct place:
- An API token. This is a long, unique string that works as authentication to the application. It can belong to a user account or a service account.
- A project name. The account associated with the API token must have access to the workspace and project in question.
Saving your credentials as environment variables#
As a best practice in your workflow, set your Neptune API token and full project name to the
NEPTUNE_PROJECT environment variables, respectively.
Finding your credentials#
In the bottom-left corner of the Neptune app, expand the user menu and select Get your API token.
Your full project name has the form
The workspace name is displayed in the top-left corner of the app. You can find and copy the full name of a project from its settings:
- In your project view, click the menu in the top-right corner.
- Select Edit project details.
- Click the copy button () next to Project.
Setting credentials in Colab#
If you're working in Google Colaboratory, you can set your credentials with the os and getpass libraries:
Note that these won't persist when the notebook kernel is terminated. You'll need to declare the variables again if you restart the notebook.
Passing credentials without environment variables#
While it's not a recommended practice especially for the API token, you can also pass your Neptune credentials in the code when initializing Neptune.
If you haven't registered, you can also log anonymously to a public project (make sure not to publish sensitive data through your source code!):