Templated Abstract Polymorphic Database - A flexible object model library
Project description
daylily-tapdb
daylily-tapdb is the shared persistence layer used by Bloom, Atlas, Dewey, Ursa, and Kahlo. It provides the template-driven object model, the lineage and audit primitives, the bootstrap/runtime CLI, and an optional admin UI package.
TapDB owns:
- the canonical core template-pack model
- template validation and loading behavior
- generic instance, lineage, audit, and outbox primitives
- shared database/bootstrap/runtime lifecycle
- the optional admin UI package
TapDB does not own:
- client-domain truth such as Atlas orders or Bloom lab state
- client-authored template packs outside the core package
- product-specific UI composition in parent apps
If you are trying to understand how the stack persists typed objects and lineage without handing domain ownership to one monolith, this repo is the substrate.
Component View
flowchart LR
Apps["Atlas / Bloom / Dewey / Ursa / Kahlo"] --> CLI["tapdb CLI and runtime helpers"]
CLI --> Core["template packs, models, validation, factories"]
Core --> PG["PostgreSQL or Aurora"]
Core --> Admin["optional FastAPI admin UI"]
Prerequisites
- Python 3.10+
- PostgreSQL for local or shared runtime work
- optional Aurora credentials and AWS access for Aurora flows
- optional
adminextra for the admin UI
Getting Started
Quickstart
source ./activate
export TAPDB_CLIENT_ID=tapdb
export TAPDB_DATABASE_NAME=tapdb
export TAPDB_ENV=dev
tapdb config init --client-id "$TAPDB_CLIENT_ID" --database-name "$TAPDB_DATABASE_NAME" --env dev --db-port dev=5533 --ui-port dev=8911
tapdb bootstrap local
Architecture
Technology
- SQLAlchemy declarative models with polymorphic inheritance
- Typer-based
tapdbCLI - PostgreSQL for local and Aurora-backed runtimes
- optional FastAPI + Jinja2 admin UI
Core Object Model
| Table / concept | Purpose |
|---|---|
generic_template |
canonical template definitions |
generic_instance |
instantiated typed objects |
generic_instance_lineage |
parent/child and related graph edges |
audit_log |
append-only change history |
outbox_event |
integration/event handoff staging |
uid |
BIGINT internal key |
euid |
public business identifier |
tenant_id |
UUID isolation key |
The packaged daylily_tapdb/core_config directory is the canonical TapDB core template pack. Client repos may define their own JSON packs under config/tapdb_templates/, but they should load them through TapDB instead of mutating templates directly at runtime.
Runtime Shape
- CLI:
tapdb - primary groups:
bootstrap,ui,config,db,pg,user,cognito,aurora - admin UI can run standalone or be mounted into a parent FastAPI app
Parent-App Embedding
The intended embedding pattern is:
- parent app owns
FastAPI()creation - parent app owns auth/session/trusted-host behavior
- TapDB is used as a library/runtime substrate
- template packs are seeded from JSON packs, not written ad hoc in product code
Cost Estimates
Approximate only.
- Local development: workstation plus a PostgreSQL instance.
- Shared dev host: modest database and storage cost, usually low tens to low hundreds per month depending on host size and retention.
- Aurora-backed use: materially higher than local due to managed database pricing and networking, but still usually a shared substrate cost for several services rather than a TapDB-only budget line.
Development Notes
- Canonical local entry path:
source ./activate - Use
tapdb ...for database lifecycle operations rather than raw SQL or shell shortcuts - Required env vars are typically
TAPDB_CLIENT_ID,TAPDB_DATABASE_NAME, andTAPDB_ENV
Useful checks:
source ./activate
tapdb --help
pytest tests/ -q --deselect tests/test_admin_routes_smoke.py
Sandboxing
- Safe: docs work,
tapdb --help, config inspection, template-pack validation, and tests against disposable local runtimes - Local-stateful: schema apply/bootstrap and local PostgreSQL start/reset commands
- Requires extra care: Aurora operations, destructive reset/delete flows, and any manual intervention outside the intended CLI
Current Docs
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file daylily_tapdb-3.0.12.tar.gz.
File metadata
- Download URL: daylily_tapdb-3.0.12.tar.gz
- Upload date:
- Size: 265.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
875d5da930f5185cceffb5b27644fd62a45ca356a8a69686100caa27a435ae7c
|
|
| MD5 |
99aa457e144017fcc80e42c58ec8bfa1
|
|
| BLAKE2b-256 |
52b9f8bdd506fe53ec03cc0a342e1ebd33652d3eaa763f2e3f6e36783e427e16
|
File details
Details for the file daylily_tapdb-3.0.12-py3-none-any.whl.
File metadata
- Download URL: daylily_tapdb-3.0.12-py3-none-any.whl
- Upload date:
- Size: 204.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b491131887116f2196d59843a10596a686cdd37d3cc0b2ce064549bb7bb0ea1a
|
|
| MD5 |
a0d6e6a942c803ff0938bf67f59fa906
|
|
| BLAKE2b-256 |
08e8e70596526f0a8b435caf90d09b0861a340e642be32dd2d27f7ed45860dbe
|