Skip to content

cloudscript

Enable CloudScript lineage tracking and SDK run reporting on the default client.

A CloudScript is an ordinary Python file that runs against CloudSprite. Call this once at the top of it::

cs.cloudscript(__file__)
cs.cloudscript(__file__, seed=42)
cs.cloudscript(__file__, install_hooks=True)  # atexit + excepthook

cs.sprite() and cs.track_script() are legacy aliases of cs.cloudscript() — same callable, no deprecation warning.

What leaves the machine when tracking is active (each channel is opt-out unless noted):

  • CloudScript source — attached as a DataFile on each publish() (opt-out; disable with upload_source=False or CLOUDSPRITE_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 (requires install_hooks=True for automatic atexit, or call cs.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

cloudscript(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.cloudscript()