lamindb.track¶
- lamindb.track(transform=None, *, project=None, space=None, params=None, new_run=None, path=None)¶
Track a run of your notebook or script.
Populates the global run
context
by managingTransform
&Run
records and caching the compute environment.If
sync_git_repo
is set, checks whether a script-like transform exists in a git repository and links it.- Parameters:
transform (
str
|Transform
|None
, default:None
) – A transform (stem)uid
(or record). IfNone
, auto-creates atransform
with itsuid
.project (
str
|Project
|None
, default:None
) – A project, itsname
oruid
for labeling entities created during the run.space (
str
|Space
|None
, default:None
) – A restricted space, itsname
oruid
for creating sensitive entities are created during the run. The default is the common"All"
space that every LaminDB instance has. Thespace
argument doesn’t affectStorage
,ULabel
,Feature
,Schema
,Param
and bionty entities as these provide structure that should typically be commonly accessible. If you want to manually move entities to a different space, set the.space
field (Manage access).params (
dict
|None
, default:None
) – A dictionary of parameters to track for the run.new_run (
bool
|None
, default:None
) – IfFalse
, loads the latest run of transform (default notebook), ifTrue
, creates new run (default non-notebook).path (
str
|None
, default:None
) – Filepath of notebook or script. Only needed if it can’t be automatically detected.
- Return type:
None
Examples
To track the run of a notebook or script, call:
ln.track() #> → created Transform('Onv04I53OgtT0000'), started new Run('dpSfd7Ds...') at 2025-04-25 11:00:03 UTC #> • recommendation: to identify the notebook across renames, pass the uid: ln.track("Onv04I53OgtT")
Ensure one version history across file renames:
ln.track("Onv04I53OgtT") #> → created Transform('Onv04I53OgtT0000'), started new Run('dpSfd7Ds...') at 2025-04-25 11:00:03 UTC
More examples: Track notebooks, scripts & functions