All docs
API Reference
Source
Source is the input a load step reads — files, a folder with globs, or a SQL query the user picks. Reference for Source.file, Source.sql, Source.of, and read.
A Source is the input a load step reads. Annotate a step parameter Source
and LSD injects a reader bound to whatever the user picks; or construct one directly with
Source.file / Source.sql / Source.of to drive a load in Python. Either way,
source.read() returns a Table — the picker's choice and the code path are
the same object, so a tool works identically whether the source is chosen in the UI or in a script.
Usage#
Python
from lsdtools import Tool, Source, Table
tool = Tool("io")
@tool.load(source_kinds=("file",))
def load_it(src: Source) -> Table:
return src.read()
# → reads whatever file the user selects in the node's form
Where to start#
Learn — Load steps · Params vs ports
Examples — File loader · Clean a CSV
Properties
- spec the serialized json spec describing this source
Class methods
- file builds a file source from explicit paths or a folder glob
- of builds a source of any registered custom kind
- sql builds a sql source from a connection and a query
Methods
- paths returns the resolved file paths a source reads
- read reads the source and returns its data as a table
By LSD Team · Last updated Jul 17, 2026
Ask on Discord
View as Markdown