From be04a44ef1d2862e53629dd51d97f21d9d090afc Mon Sep 17 00:00:00 2001 From: Sabine Date: Tue, 26 Nov 2024 17:20:42 +0200 Subject: [PATCH 1/2] tweak docstring --- src/neptune_scale/projects.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/neptune_scale/projects.py b/src/neptune_scale/projects.py index a119054d..e6bbc3f6 100644 --- a/src/neptune_scale/projects.py +++ b/src/neptune_scale/projects.py @@ -25,26 +25,20 @@ def create_project( """Creates a new project in a Neptune workspace. Args: - name: The name for the project in Neptune. Can contain letters and hyphens. For example, "classification". - If you leave out the workspace argument, include the workspace name here, - in the form "workspace-name/project-name". For example, "ml-team/classification". - workspace: Name of your Neptune workspace. - If None, it will be parsed from the name argument. + name (str): Name of the project. Can contain letters and hyphens (-). For example, "project-x". + workspace (str, optional): Name of your Neptune workspace. + You can omit this argument if you include the workspace name in the `name` argument. visibility: Level of privacy for the project. Options: - "pub": Public. Anyone on the internet can see it. - - "priv": Private. Only users specifically assigned to the project can access it. Requires a plan with + - "priv" (default): Private. Only users specifically assigned to the project can access it. Requires a plan with project-level access control. - "workspace" (team workspaces only): Accessible to all workspace members. - The default is "priv". - description: Project description. - If None, it will be left empty. + description: Project description. If None, it's left empty. key: Project identifier. Must contain 1-10 upper case letters or numbers (at least one letter). - For example, "CLS2". If you leave it out, Neptune generates a project key for you. - fail_if_exists: If the project already exists and this flag is True, an error is raised. + For example, "PX2". If you leave it out, Neptune generates a project key for you. + fail_if_exists: If the project already exists and this flag is set to `True`, an error is raised. api_token: Account's API token. - If None, the value of the NEPTUNE_API_TOKEN environment variable is used. - Note: To keep your token secure, use the NEPTUNE_API_TOKEN environment variable rather than placing your - API token in plain text in your source code. + If not provided, the value of the NEPTUNE_API_TOKEN environment variable is used (recommended). Returns: The name of the new project created. From 8e72331022a9f110b074618e39d75650a47b87df Mon Sep 17 00:00:00 2001 From: Sabine Date: Tue, 26 Nov 2024 17:31:37 +0200 Subject: [PATCH 2/2] update setup instructions --- README.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 58d956d4..8d745dea 100644 --- a/README.md +++ b/README.md @@ -24,21 +24,37 @@ pip install neptune-scale ### Configure API token and project 1. Log in to your Neptune Scale workspace. -1. Create a project, or find an existing project you want to send the run metadata to. 1. Get your API token from your user menu in the bottom left corner. > If you're a workspace admin, you can also set up a service account. This way, multiple people or machines can share the same API token. To get started, access the workspace settings via the user menu. -1. In the environment where neptune-scale is installed, set the following environment variables to the API token and project name: +1. In the environment where neptune-scale is installed, save your API token to the `NEPTUNE_API_TOKEN` environment variable: ``` - export NEPTUNE_API_TOKEN="h0dHBzOi8aHR0cHM.4kl0jvYh3Kb8...ifQ==" + export NEPTUNE_API_TOKEN="h0dHBzOi8aHR0cHM6...Y2MifQ==" ``` +1. Create a project, or find an existing project you want to send the run metadata to. + + To create a project via API: + + ```python + from neptune_scale import create_project + + create_project( + name="project-x", + workspace="team-alpha", + ) ``` + +1. (optional) In the environment where neptune-scale is installed, save your full project path to the `NEPTUNE_PROJECT` environment variable: + + ```bash export NEPTUNE_PROJECT="team-alpha/project-x" ``` + > If you skip this step, you need to pass the project name as an argument each time you start a run. + You're ready to start using Neptune Scale. For more help with setup, see [Get started][scale-docs] in the Neptune documentation.