All docs
Tool
Tool is the one object per package you decorate functions with to make LSD nodes, commands, and views. Reference for every decorator and method.
Tool is the single registration object in a package: you create one at module scope, then hang
every node and contribution off its decorators. It only declares — it never runs — so importing
a package's module makes its nodes appear in the graph while an Engine (or the desktop) executes the
wired steps. A node's identity is f"{tool_name}.{fn_name}", which is what keeps two packages'
same-named functions from colliding.
Usage#
from lsdtools import Tool, Table
tool = Tool("hello", label="Hello")
@tool.load
def numbers(count: int = 5) -> Table:
return Table({"n": list(range(count))})
# → a node "hello.numbers" in the palette, with a count field
Where to start#
Learn — The Tool object · Parameters vs ports · Load steps · Shape steps · Deliver steps · Commands & actions · Contributing UI
Examples — Your first tool · A CLI command · A panel · A complete package
API — Context · Source · Table · UI overview · Advanced
Methods
- contribute adds hand-built contribution objects the decorators can't express
- dispatch invokes a registered action by its route
- mount registers the tool's commands, views, and app-actions into a host
Decorators
- action registers a routed action that UI can invoke by route
- command declares an lsd CLI command from a typed function
- deliver declares an export step — a Table in, a file written or a ViewerPayload out
- entity registers a creatable entity type from a builder or an Entity subclass
- load declares a step that produces a table from nothing, a file, or a source
- shape declares a transform step — table input ports in, a table out
- source registers a custom source kind on a read(cfg) function
- template declares a drag-drop import template that builds a pre-wired entity
- view contributes a view (editor, sidebar, or overlay) whose factory returns a View