Sandbox — LSD is in active testing. All systems operational·payments are test-mode (no real charges).
Overview Use Cases News Docs Tool Store Support Community Get LSD
All docs
Docs/ API Reference/ Context
API Reference

Context

StepContext and Context are what LSD injects into your functions — progress, cancellation, outputs, plus the host, engine, project, and UI slots.

StepContext and Context are injected parameters — annotate one and LSD hands it to your function. StepContext (inside a step's run) exposes only cache-neutral capabilities — progress, cancellation, side outputs, scratch dirs — deliberately, so a step can't read state the resume-cache key cannot see. Context (inside a command, action, or view) is the one discoverable handle on the running application. Neither is part of the cache key, so touching them never invalidates a cached result.

Usage#

Python
from lsdtools import Tool, Table, StepContext

tool = Tool("demo")

@tool.shape
def slow(t: Table, ctx: StepContext) -> Table:
    ctx.progress(0.5, "halfway")
    return t
# → ctx is injected at run time, excluded from the cache key

Where to start#

LearnParameters vs ports · Commands & actions

APITool · Engine · Source

ExamplesLive node metrics · A CLI command

Properties

Class methods

Methods

By LSD Team · Last updated Jul 18, 2026 Ask on Discord View as Markdown