tisserande.tracking.decorator

Tracking decorators: @track, @track_async, and track_shell().

These are the primary user-facing API for automatic provenance capture.

Attributes

F

Functions

configure(→ None)

Configure the tracking system.

get_backend(...)

Get the currently configured backend.

track(…)

Decorator to track execution provenance of a sync function.

track_async(…)

Decorator to track execution provenance of an async function.

track_shell(→ subprocess.CompletedProcess[str])

Execute and track a shell command.

Module Contents

tisserande.tracking.decorator.F[source]
tisserande.tracking.decorator.configure(*, backend: tisserande.tracking.backends.TrackingBackend | None = None, db_url: str | None = None) None[source]

Configure the tracking system.

Must be called before @track is used (unless a backend is passed directly to the decorator). If neither backend nor db_url is provided, creates a LocalSyncBackend with the default DB URL from config.

tisserande.tracking.decorator.get_backend() tisserande.tracking.backends.TrackingBackend | None[source]

Get the currently configured backend.

tisserande.tracking.decorator.track(func: F) F[source]
tisserande.tracking.decorator.track(*, backend: tisserande.tracking.backends.TrackingBackend | None = None, track_inputs: bool = True, track_outputs: bool = True) collections.abc.Callable[[F], F]

Decorator to track execution provenance of a sync function.

Can be used with or without arguments:

@track def my_func(…): …

@track(track_outputs=False) def my_func(…): …

tisserande.tracking.decorator.track_async(func: F) F[source]
tisserande.tracking.decorator.track_async(*, backend: tisserande.tracking.backends.TrackingBackend | None = None, track_inputs: bool = True, track_outputs: bool = True) collections.abc.Callable[[F], F]

Decorator to track execution provenance of an async function.

tisserande.tracking.decorator.track_shell(command: str | list[str], *, inputs: dict[str, Any] | None = None, outputs: dict[str, Any] | None = None, backend: tisserande.tracking.backends.TrackingBackend | None = None) subprocess.CompletedProcess[str][source]

Execute and track a shell command.

Parameters:
  • command – Shell command to execute

  • inputs – Dict mapping arg names to values (tracked as input data nodes)

  • outputs – Dict mapping output names to values (tracked as output data nodes)