Write a transform
A transform turns what a source brought in into shared measures, stored in dataset tables. Each one is a Python package with an entry point, the same pattern as a source.
- Say what it reads and writesSet source_tables to the tables it reads, and target_table to the dataset table it writes into.
- Write run()run(conn) gets a DuckDB connection. Read from the source tables and write rows into self.target_table.
- Register the entry pointAdd a shenas.transforms entry point to your pyproject.toml, pointing at the transform class. Install it and schedule it with shenasctl transform add.
Kinds that come with shenas
SQLA DuckDB query that reads from source tables and writes into a dataset table. No Python needed.
GeofenceTags rows with a place name from their GPS coordinates and the places you define: home, office, the gym.
GeocodeTurns a latitude and longitude into a city, a country or an address, with a local geocoder and no outside service.
Regex extractPulls fields out of text columns with named capture groups: transaction descriptions, log lines, notes.
LLM categorizePasses rows to a local model to label them: transactions, mood tags, topics.
Your ownImplement the Transform base class for anything else. It gets a DuckDB connection and writes to the table it declares.
Working examples are under plugins/transforms/ in the repository: shenas-org/shenas Public mirror (shenas-org/shenas): Last updated 2026-05-23. Treat it as frozen; do not rely on it for current releases.
Other kinds
SourcesBring data in from a service or a local file.dlt
SurfacesScreens: charts, tables, timelines, anything visual.Lit web components, Arrow IPC
DatasetsThe shared tables transforms write into, such as daily HRV, transactions or events.Python dataclasses
FrontendThe shell around everything is a plugin too: write your own or extend the default.
ThemeStyles everything at once: a stylesheet and a small class.CSS custom properties
AnalysisWays of testing a hypothesis: the operations it may use and how it chooses them.operation vocabulary, recipe strategy