lamindb.track(*, transform=None, new_run=None, path=None)#

Track notebook or script run.

Creates or loads a global Run that enables data lineage tracking. You can find it in run_context.

Saves source code and compute environment.

If sync_git_repo is set, will first check whether the script exists in the git repository and add a link.

  • transform (Optional[Transform], default: None) – Can be of type “pipeline” or “notebook” (TransformType).

  • new_run (Optional[bool], default: None) – If False, loads latest run of transform (default notebook), if True, creates new run (default pipeline).

  • path (Optional[str], default: None) – Filepath of notebook or script. Only needed if it can’t be automatically detected.

Return type:



To track a notebook or script, call:

>>> import lamindb as ln
>>> ln.track()

If you’d like to track an abstract pipeline run, pass a Transform object of type "pipeline":

>>> ln.Transform(name="Cell Ranger", version="2", type="pipeline").save()
>>> transform = ln.Transform.filter(name="Cell Ranger", version="2").one()
>>> ln.track(transform=transform)