Skip to content

Log project level metadata#

Project metadata helps you maintain a single source of truth for runs and models tracked in the project.

In each project, there is a Project metadata tab. You can log metadata to this section by initializing a project object with your project name.

How it works#

Initialize a project named ml-team/classification like this:

import neptune

project = neptune.init_project(project="ml-team/classification")

You can now log metadata to the project object as you normally would.

project["general/brief"] = URL_TO_PROJECT_BRIEF
project["general/data_analysis"].upload("data_analysis.ipynb")

project["dataset/latest"].track_files("s3://datasets/images")

Then, if you start a run, you can fetch and use already tracked metadata from the project:

run = neptune.init_run()
run["dataset"] = project["dataset/latest"].fetch()

Note on collaboration

The project object follows the same logic as other Neptune objects: If you assign a new value to an existing field, the new value overwrites the previous one.

In a given project, you always initialize and work with the same project object, so take care not to accidentally overwrite each other's entries if your team is collaborating on project metadata.

Tip: Recall that the append() method appends the logged value to a series. It works for text strings as well as numerical values.

Example: Storing an "allowed names" list for the project#

To ensure that your team is logging metrics and other metadata using the same labels, you could store an "allowed names" list in the Project metadata section. The benefit of this strategy is that you can access the "allowed" lists via API, directly from the target project where the runs are being logged.

Logging allowed names to the project metadata
project = neptune.init_project(project="ml-team/classification")

metric_names = ["acc", "loss", "mae", ...]
project["allowed/metrics"].extend(metric_names)
Fetching list of allowed names
project = neptune.init_project(project="ml-team/classification", mode="read-only")

list(project["allowed/metrics"].fetch_values()["value"])