track_script¶
Enable lineage tracking and SDK run reporting on the default client.
Call once at the top of your script::
cs.track_script(__file__)
cs.track_script(__file__, seed=42)
cs.track_script(__file__, install_hooks=True) # atexit + excepthook
What leaves the machine when tracking is active (each channel is opt-out unless noted):
- Script source — attached as a DataFile on each
publish()(opt-out; disable withupload_source=FalseorCLOUDSPRITE_NO_SOURCE_UPLOAD=1). - Git state — HEAD sha (+ optional
-dirty) in the run report. Never remote URL or OS username. - Error text — exception type + message only on failure (no traceback frames or absolute paths).
- Run report —
POST /api/script-runs/with dataset I/O ids, content hash, sdk version, seed, status (requiresinstall_hooks=Truefor automatic atexit, or callcs.report_run()).
sys.excepthook / atexit are not installed by default; pass
install_hooks=True to enable them.
Blanket: CLOUDSPRITE_NO_TELEMETRY=1 disables source upload, git state,
and error text.
Signature¶
track_script(file_path: str | None=None, seed: object=None, *, install_hooks: bool | None=None, upload_source: bool | None=None, include_git: bool | None=None, include_error: bool | None=None) -> None
Parameters¶
| Name | Type | Required | Default |
|---|---|---|---|
file_path |
str \| None |
no | None |
seed |
object |
no | None |
install_hooks |
bool \| None |
no | None |
upload_source |
bool \| None |
no | None |
include_git |
bool \| None |
no | None |
include_error |
bool \| None |
no | None |
Fields¶
| Field |
|---|
file_path |
seed |
install_hooks |
upload_source |
include_git |
include_error |
Return shape¶
None
Permission¶
This is a local SDK helper. It does not call the CloudSprite HTTP API.
Usage¶
cs.track_script()