This release is a pre-release and may not be stable for production use.
flowbook — a framework for flexible data flows.
Quickstart
pip install flowbook
flowbook --version
flowbook doctor
Core-only install depends on pydantic only (no pandas). It runs plans over JSON, bytes and tables. Add extras as needed:
| Extra | Adds | For |
|---|---|---|
table |
openpyxl | Excel read/write for tables (no pandas) |
pandas |
pandas | DataFrame values, put_df / get_df, *_df steps |
excel |
pandas, openpyxl, xlrd | DataFrame-based Excel steps (.xlsx, .xls) |
sql |
SQLAlchemy | SQL steps (sql_query, sql_query_table, sql_execute) |
postgres |
psycopg, SQLAlchemy, pandas, pyarrow | Postgres store and databases |
fastapi |
FastAPI, uvicorn | HTTP API |
ai |
openai | chat_completion step |
full |
table, pandas, postgres, fastapi | Everything above except ai and xlrd |
pip install "flowbook[table]" # tables + Excel, no pandas
pip install "flowbook[full]"
Optional: add bundled configs for hands-on (no extra deps):
pip install "flowbook[full,demo]"
Dev CLI (Typer/Rich) for local development and demos:
pip install "flowbook[dev]"
flowbook --version
flowbook doctor
flowbook db init # Create schema (first-time only)
flowbook db reset # DB reset + seed (needs flowbook[dev])
flowbook db up # Start Postgres (Docker, optional)
flowbook api # Run API (uvicorn)
flowbook streamlit # Streamlit UI (venv)
flowbook hands-on # API hands-on flow
flowbook steps list # List available steps (ops)
flowbook steps show <op_name> # Show step spec (inputs, outputs)
flowbook run (no extra needed) runs a plan file locally with an in-memory store:
flowbook run --plan plan.json --input src=@book.xlsx --input sheet=Sheet1 --out out/
flowbook run --plan plan.json --input src=@book.xlsx --json # machine-readable result
Inputs: key=@file (bytes), key=str:text, key=json:..., or key=value (JSON if it parses, else string). --database name=URL registers a database for SQL steps.
Exit codes: 0 ok, 1 warnings, 2 validation errors or failed run, 3 invalid input (missing file, unknown op, unbound input).
flowbook doctor prints Python/OS/flowbook version and suggests pip install "flowbook[table]", "flowbook[pandas]", "flowbook[postgres]", "flowbook[fastapi]", or "flowbook[full]" for missing extensions.
Concept
- Config-driven: Which steps run, in what order, and how inputs are bound—all come from config (plan config, ConfigStore, plans). Change the flow without changing framework code.
- Steps (ops): Flowbook uses pluggable steps (ops). Each step has inputs and outputs; plans compose steps. List available steps:
flowbook steps list. Show step details (docstring, inputs, outputs):flowbook steps show <op_name>. API:GET /steps,GET /steps/{op_name}. Streamlit: Steps tab. - Extend via extensions: The behavior of each step is an op registered in a
Registry. Add new ops in your own package; the framework only resolvesop name → run op. No need to touch the core. - Single data rule: Data lives only in Artifacts; steps receive resolved values and return a dict. Contracts are explicit (e.g.
PortSpecfor inputs). - AI-friendly: Config (plans, rules, mappings) is easy for LLMs to generate or choose. New ops (including AI-backed ones) plug in the same way. You can call LLMs inside an op; the engine stays agnostic.
- Tables: the core tabular value is a plain-JSON table (
flowbook.core.table): typed columns, primary key, positional rows, optional source (sheet) row numbers. No pandas needed. Steps:table_read_excel,table_write_excel(extratable),table_validate(types, nullability, primary key, rules such asnot_null,unique,allowed,pattern,range),table_diff,sql_query_table;table_to_df/df_to_tablewith pandas. - Issues: a step may return
_issues(severity:error/warning/review). They are collected intoRunInfo.issues, the results meta, the API response (issues,exit_code) and theflowbook runexit code. - Values by kind:
session.put_input_value(name, value)/store.put_object(key, value)persist bytes, tables and JSON in core; extensions register more kinds (e.g. pandas DataFrame viaflowbook.serializers). Extension-only methods such asput_df/get_dfare added through theflowbook.methodsentry points and exist only when the extension is installed.
Usage (high-level)
- Engine = store (artifacts) + registry (ops) + optional config store. You build it once.
- Session =
with engine.create_run() as session:. Put inputs (logical name → value), then run a plan config (list of steps withname,op,inputs). - Optionally run a planner first (e.g.
load_plan); it produces a plan config that you then execute in the same session. - Steps read from the store (via resolved inputs) and write outputs back; later steps can depend on them. All orchestration is driven by config; new capabilities are new ops in your extensions.
To add your own steps: see Adding custom steps (minimal: one module + one line at startup; optional: package with entry points). To compose plans from steps: see Plan from steps. To add CLI commands: see Adding custom CLI.
Development
- CI before commit:
npm run ci(lint, typecheck, test) runs automatically via pre-commit. It runs only unit (and smoke) tests; integration and e2e are skipped so CI does not require Postgres. After clone, run:uv sync pre-commit install
(The dev group includes full extras so tests can run; for a minimal env usepip install flowbookonly.) - Full test suite (integration + e2e): Start Postgres (see below), then
npm run testoruv run pytest. To run only integration:uv run pytest -m integration. - Releasing: See Releasing. Publish = tag + twine upload. Pre-release (alpha/beta) = push to dev branch only.
License
Apache License 2.0. Copyright 2026 d4c.dev (see NOTICE).
Dev commands
The commands below are for local development. The Docker subcommands (flowbook db up, flowbook api up, flowbook streamlit up) require an infra/ directory (compose files, env files). Clone this repo or copy infra/ to use them.
.env: uv does not auto-load .env. Use uv run --env-file .env flowbook ... or export UV_ENV_FILE=.env. Or use npm run api / npm run hands-on which pass --env-file .env.
Dev / Demo
API and UIs run from the repo for development and demos. Without FLOWBOOK_DATABASE_URL the API uses an in-memory store (POST /run works; saved configs, /import and results history need Postgres).
Postgres
Run Postgres (local install, cloud, or Docker):
# Option: Docker Compose (requires infra/)
flowbook db up # Start Postgres (uses infra/.env.postgres)
flowbook db down # Stop Postgres
Use --env-file PATH / --no-env-file to override. Or run Postgres yourself and set FLOWBOOK_DATABASE_URL.
First-time: Docker Compose runs init scripts automatically. For cloud or local Postgres, run FLOWBOOK_DB_RESET=1 flowbook db init to create the schema.
API
# With .env: cp .env.example .env, then:
npm run api
# Or: uv run --env-file .env flowbook api
# Or: UV_ENV_FILE=.env uv run flowbook api
API docs: http://localhost:8000/docs
Docker: flowbook api up / flowbook api down (uses infra/.env.api, network_mode: host). Cloud deploy: docker build -f infra/Dockerfile.api -t flowbook-api . — set FLOWBOOK_DATABASE_URL via env/secrets; image listens on $PORT.
Web UI (React, prototype)
cd ui && npm install && npm run dev # http://localhost:5173, proxies /api to :8000
Run a pasted plan with attached files (POST /run), see validation issues, preview tables, download outputs as files or Excel. Also lists artifacts and steps. Needs Node; not included in the Python package. See ui/README.md.
Streamlit UI (sample)
flowbook streamlit
Runs in a separate venv (pandas version compatibility). Requires the API. If you see ModuleNotFoundError: altair.vegalite.v4, remove .venv-ui and run again.
Tabs: Health, Chat, Inspect, Import, Export, Results, Artifacts, Entities, Configs, AI Edit, Steps.
Docker: flowbook streamlit up / flowbook streamlit down (uses infra/.env.streamlit). Cloud deploy: docker build -f infra/Dockerfile.streamlit -t flowbook-streamlit . — set FLOWBOOK_API_URL via env/secrets.
DB init and reset (dev only)
First-time setup (empty DB, no tables): Create schema before reset. Requires FLOWBOOK_DB_RESET=1 and localhost DSN.
Reset (truncate + seed): Same safety requirements. Run flowbook db init first if the DB has no schema.
FLOWBOOK_DATABASE_URL=... FLOWBOOK_DB_RESET=1 flowbook db init
FLOWBOOK_DATABASE_URL=... FLOWBOOK_DB_RESET=1 flowbook db reset
flowbook db init creates entities, runs, results, artifacts, configs. flowbook db reset truncates them and seeds from bundled configs (flowbook[demo]) + overlay from configs/ (default --config-dir configs). Use --config-dir bundled for bundled only.
Hands-on flow
flowbook hands-on
Runs Health -> Inspect -> Import -> Artifacts -> Export -> Download (interactive). Requires API up and a fixture. Excel import supports .xlsx and .xls (region-based import uses df-based detection). Generate fixture:
flowbook fixture generate -o tests/fixtures/excel
Metadata
Release files for flowbook 0.1.0a11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flowbook-0.1.0a11.tar.gz | 278.2 kB | Without provenance | Details for flowbook-0.1.0a11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flowbook-0.1.0a11-py3-none-any.whl | Python 3 | none | any | Details for flowbook-0.1.0a11-py3-none-any.whl |
Total release size: 447.6 kB
Release files / flowbook-0.1.0a11.tar.gz
| Download URL | flowbook-0.1.0a11.tar.gz |
|---|---|
| Size | 278.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22bab0eff7b1912add73d93d79708991bbed6966de88786918498e97e6e7090c
|
|
BLAKE2b-256 checksum How to use checksums |
02d9983e0c8b51a64072350b397e0f4a43b415a0e483e0e593267d57c06c8797
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / flowbook-0.1.0a11-py3-none-any.whl
| Download URL | flowbook-0.1.0a11-py3-none-any.whl |
|---|---|
| Size | 169.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3068d78d60e7ea72429f3dd40da476513475b2645391203cbb61adc07e3b715b
|
|
BLAKE2b-256 checksum How to use checksums |
e8873bc6aed39b3e69b3429a490e6c1c3fd288e28a80b7a973f940ac4a7dd0fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Security for flowbook 0.1.0a11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.