Metadata-Version: 2.4
Name: daylily-tapdb
Version: 9.0.9
Summary: Templated Abstract Polymorphic Database - A flexible object model library
Author-email: Daylily Informatics <info@daylilyinformatics.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Daylily-Informatics/tapdb-core
Project-URL: Repository, https://github.com/Daylily-Informatics/tapdb-core.git
Project-URL: Documentation, https://daylily-tapdb.readthedocs.io
Keywords: database,orm,polymorphic,templates,sqlalchemy,lims
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sqlalchemy>=2.0
Requires-Dist: psycopg2-binary>=2.9
Requires-Dist: pydantic
Requires-Dist: jsonschema>=4.0
Requires-Dist: typer
Requires-Dist: rich
Requires-Dist: pyyaml
Requires-Dist: uuid6>=2024.1.12
Requires-Dist: cli-core-yo==2.1.1
Requires-Dist: meridian-euid==0.4.7
Provides-Extra: dev
Requires-Dist: cli-core-yo==2.1.1; extra == "dev"
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: playwright>=1.45; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: httpx; extra == "dev"
Requires-Dist: python-multipart; extra == "dev"
Requires-Dist: pre-commit>=3.8.0; extra == "dev"
Requires-Dist: bandit[toml]>=1.8.0; extra == "dev"
Requires-Dist: detect-secrets>=1.4; extra == "dev"
Requires-Dist: setuptools_scm>=8.0; extra == "dev"
Provides-Extra: cli
Provides-Extra: aurora
Requires-Dist: boto3>=1.34; extra == "aurora"
Requires-Dist: botocore; extra == "aurora"
Provides-Extra: api
Requires-Dist: fastapi; extra == "api"
Provides-Extra: gui
Requires-Dist: fastapi; extra == "gui"
Requires-Dist: jinja2; extra == "gui"
Provides-Extra: admin
Requires-Dist: fastapi; extra == "admin"
Requires-Dist: uvicorn; extra == "admin"
Requires-Dist: jinja2; extra == "admin"
Requires-Dist: python-multipart; extra == "admin"
Requires-Dist: itsdangerous; extra == "admin"
Requires-Dist: daylily-auth-cognito==2.1.5; extra == "admin"
Requires-Dist: passlib[bcrypt]; extra == "admin"
Requires-Dist: bcrypt<4; extra == "admin"
Dynamic: license-file

<p align="center">
  <strong>TapDB</strong><br>
  Templated Abstract Polymorphic Database for Dayhoff objects, EUIDs, lineage, audit, and embeddable GUI/API surfaces.
</p>

<p align="center">
  <a href="docs/runtime-and-cli.md">Runtime</a> ·
  <a href="docs/integration-and-embedding.md">Embedding</a> ·
  <a href="docs/template-authoring.md">Templates</a> ·
  <a href="docs/dag_spec.md">DAG</a>
</p>

## Overview

TapDB is the shared substrate library for typed templates, generic instances, EUIDs, lineage, audit, external references, and embeddable object GUI/API surfaces. It is not a workflow engine, clinical decision engine, or service-specific application.

Current Dayhoff pin: `9.0.5`.

Active clients mount TapDB with `TapdbHostBridge` and `create_tapdb_gui_app` at `/tapdb` when they need generic object/template/lineage UI.

## What It Does

| Capability | Current surface |
|---|---|
| Templates and generic instances | CLI, Python APIs, embedded GUI, embedded JSON/action APIs |
| EUID object detail | `/tapdb/object/{euid}` plus object APIs |
| Lineage and external references | Graph/detail pages and lineage/external-link APIs |
| Template creation and validation | GUI/API routes and template tests |
| Audit and metrics | Object audit/admin readiness/metrics pages where configured |

## How It Works

TapDB provides substrate primitives only. Host services supply auth, styling, config path, and app identity through `TapdbHostBridge`; TapDB supplies mount-aware pages and actions over templates, generic instances, lineage, audit, and external refs. Business workflows, clinical policy, and service-specific validation stay in the owning service.

## Quickstart

```bash
cd /Users/jmajor/projects/mega_dayhoff/repos_work/daylily-tapdb
source ./activate
tapdb --help
tapdb --config /abs/path/to/tapdb-config.yaml db schema apply
tapdb --config /abs/path/to/tapdb-config.yaml db data seed
```

Always pass an explicit `--config`. Do not rely on ambient `TAPDB_*`, `PG*`, default database names, or implicit localhost/public-schema behavior.

## CLI Interface

The primary CLI is `tapdb`. It covers schema apply/migrate, template seed/load/validate, generic object operations, admin server helpers, and runtime diagnostics.

Common command families:

| Family | Purpose |
|---|---|
| `tapdb db schema ...` | Apply or migrate schema through supported migration files. |
| `tapdb db data ...` | Seed template/data packs through explicit config. |
| `tapdb templates ...` | Validate and load template packs. |
| `tapdb objects/lineage ...` | Work with generic instances and lineage where exposed by CLI. |
| `tapdb admin ...` | Start or inspect admin/embedded GUI support where configured. |

For TapDB, the CLI, embeddable JSON/action APIs, and embeddable GUI are alternate surfaces over the same object/template/lineage/audit substrate. Client services decide which surfaces they expose.

## GUI

TapDB provides an embeddable FastAPI GUI. The client-safe pattern is:

```python
from daylily_tapdb.web import TapdbHostBridge, create_tapdb_gui_app

app.mount("/tapdb", create_tapdb_gui_app(config_path="/abs/path/to/tapdb-config.yaml", host_bridge=bridge))
```

Current GUI routes include `/tapdb/`, `/tapdb/search`, `/tapdb/templates`, `/tapdb/templates/new`, `/tapdb/create/{template_euid}`, `/tapdb/object/{euid}`, `/tapdb/object/{euid}/graph`, `/tapdb/object/{euid}/external-links/new`, and admin readiness/metrics pages.

## API

TapDB exposes matching embedded APIs for search, object detail, graph, edit JSON, status, lineage, external links, template validate, create instance, readiness, Meridian validation, and metrics.

TapDB stores v0 graph metadata on existing lineage records using `json_addl.properties.v0_edge` when canonical v0 edge metadata is present. It does not add v0-specific tables.

## Testing Info

Focused checks:

```bash
python -m pytest tests -q
python -m pytest tests/test_gui_json_editor.py -q
```

Client integration tests should prove mounted `/tapdb` routes through the host service, host-session auth, admin role mapping, template creation, object detail/edit, audit, graph, and external-link behavior.

## Technical Details, History, And Linkouts

- [`docs/runtime-and-cli.md`](docs/runtime-and-cli.md): runtime and CLI details.
- [`docs/integration-and-embedding.md`](docs/integration-and-embedding.md): service embedding guide.
- [`docs/template-authoring.md`](docs/template-authoring.md): template authoring.
- [`docs/dag_spec.md`](docs/dag_spec.md): DAG/lineage model.
- [`docs/identity-and-scoping.md`](docs/identity-and-scoping.md): identity, EUID, tenant, and scope model.
- [`docs/plans/`](docs/plans/): TapDB ledgers.

TapDB remains substrate-first. Service-specific workflow rules belong in the owning service.
