Skip to content

Examples

Small, focused opendataframework projects, each isolating exactly one core abstraction, with runnable code you can read end-to-end. They live in examples/ in the repo; each has its own README.md with a full walkthrough. Read 1–7 in order — each one builds on ideas from the last.

# Example Concept(s) Docs
1 01-entity-repository/ Entity + Repository, backed by a SQLite @Component. The smallest possible data layer — no Service, no UI. Entity, Repository
2 02-component-and-context/ Two Components with a constructor dependency, showing the Context's dependency-ordered on_start()/on_stop() lifecycle. Component, Context
3 03-service/ A Heartbeat Service: setup() → run() → stop(), run() backgrounded by the framework. Deliberately not an API server. Service
4 04-task-and-pipeline/ Two Tasks composed into a Pipeline that coordinates them, run explicitly via project.context.get(...).execute(). Task, Pipeline
5 05-layer/ Components split across two Layers (@Storage, @Analytics), read back through project.context.get(cls). Layer
6 06-logger-and-view/ A Repository with an injected logger: Logger and data_view()/replay_field() (View) — per-component logging and self-describing data representation. Logger, View
7 07-config-environments/ Same app/ code, two config directories (config/dev/, config/prod/) — no environment flag, just a different path. Config

Every example is self-contained: config.toml (or a config/ directory) plus an app/ package, runnable with python main.py from inside the example's own directory. None of them add third-party dependencies beyond opendataframework itself and the Python standard library.

Looking for the CLI, UI, MCP, or chat?

Those, and the full DataView catalog, are out of scope here on purpose — see the odf package's own examples/ instead, which depends on opendataframework and demonstrates that surface.

Why no Namespace or Project example

Namespace and Project appear as supporting cast throughout every example above (every main.py uses Project; every decorator is built on Namespace), so a standalone example would mostly repeat what's already shown.