lamindb.track¶
- lamindb.track(transform=None, *, project=None, params=None, new_run=None, path=None)¶
Track a global run of your Python session.
sets
transform&runby creating or loadingTransform&Runrecordssaves Python environment as a
requirements.txtfile:run.environment
If
sync_git_repois set, checks whether a script-like transform exists in a git repository and links it.- Parameters:
transform (
str|Transform|None, default:None) – A transformuidor record. IfNone, creates auid.project (
str|None, default:None) – A projectnameoruidfor labeling entities created during the run.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()
If you want to ensure a single version history across renames of the notebook or script, pass the auto-generated
uidthat you’ll find in the logs:>>> ln.track("Onv04I53OgtT0000") # example uid, the last four characters encode the version of the transform