default template¶
The bare starting point every other template builds on: one Entity, one
Repository, one sqlite3-backed Storage. No dependencies beyond
opendataframework and the Python standard library; odf run with its default
UI needs the odf[ui] extra.
Layout¶
my-project/
├── config.toml
└── app/
├── __init__.py
├── entities.py # Item
├── repositories.py # Items(SQLite)
└── storages.py # SQLite
What's registered¶
Item(app/entities.py) — an@Entitydataclasswithid,name,quantity.Items(app/repositories.py) — an@Storage @Repository(Item)backed bySQLite, exposingall()/get()/save()/delete().SQLite(app/storages.py) — an@Storage @Componentregistered assqlite(keycomponent.sqlite) that opens the path from[component.sqlite] pathin config (default"app.db") and creates theitemstable if it doesn't exist yet.
app/__init__.py imports entities, repositories, and storages so
their decorators register as a side effect — see Server
for why that import matters.
Run it¶
odf runUI running at http://127.0.0.1:4747
Open the UI — Items renders as a plain table with no extra step needed.
Every other template starts from exactly this layout and adds one thing
on top — see the Templates comparison for
data-analytics, data-science, data-engineering, and research.