Skip to content

default template

odf init my-project

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 @Entity dataclass with id, name, quantity.
  • Items (app/repositories.py) — an @Storage @Repository(Item) backed by SQLite, exposing all()/get()/save()/delete().
  • SQLite (app/storages.py) — an @Storage @Component registered as sqlite (key component.sqlite) that opens the path from [component.sqlite] path in config (default "app.db") and creates the items table if it doesn't exist yet.
# config.toml
[project]
name = "my-project"

[component.sqlite]
path = "app.db"

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.