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/ Engine
API Reference

Engine

Engine runs pipelines in Python — ephemeral, from a .lsd file, or a project dir. Reference for add, run, save, load, and the RunResult it returns.

Engine is the runtime that executes pipelines outside the desktop — in a script, a test, or CI — on the exact engine the desktop uses. It owns the workspace, the event bus, and the entity collection, and orchestrates runs in dependency order. Construct it three ways — ephemeral (in-memory), from a .lsd file, or from a project directory — then wire steps and call run; runs are cached, so resume=True reuses unchanged steps.

Usage#

Python
from lsdtools import Engine

result = Engine().run(top(numbers(count=6), limit=3))
result.output.print()
# → the final Table, with each step cached

Three ways to anchor an engine to a project:

Python
Engine()               # ephemeral: in-memory, nothing persisted
Engine("survey.lsd")   # a single-file project
Engine("project_dir")  # a directory-backed project

Entities run, views show#

An Engine holds two kinds of thing, and add takes either: entities you run and views you show. The two verbs mirror each other exactly — run_all() executes every entity, show() presents every attached view:

Python
from lsdtools import Engine, views

engine = Engine()
engine.add(drillholes(collar="collars.csv", survey="survey.csv"))   # an entity → run
grid = views.table(title="Assays").watch("drillholes")              # a view that follows it
engine.add(grid)                                                    # a view → show

engine.run_all()      # entities run in dependency order; the view holds the output
engine.show()         # present every attached view (a window, or console text when headless)
  • engine.add(entity) attaches a pipeline; engine.add(view) attaches a View. Attaching a view also subscribes its watch links to the bus, so a watch declared before either was added resolves right then.
  • engine.views lists the attached views; engine.view(name) fetches one; engine.remove_view(v) detaches it.
  • show(mode="auto", title=None, block=True) opens one window hosting all views when a front-end is loaded, else prints each view's titled text rendering. run_all() / save() / load() are documented on their own pages below.

A deliver step that returns a ViewerPayload is routed to whatever view watches its entity — so a run can populate a viewer with no extra wiring.

Where to start#

LearnNode variants · Tables & data flow

ExamplesYour first tool · Multi-output mesh

APIRunResult · Table · Tool · Runtime

Class methods

Methods

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