Metadata-Version: 2.4
Name: ankor
Version: 0.5.135
Summary: Workflow monitoring and management for FastAPI apps
License: MIT
Classifier: Framework :: FastAPI
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.11
Requires-Dist: alembic>=1.14.0
Requires-Dist: apscheduler>=3.10.0
Requires-Dist: asyncpg>=0.30.0
Requires-Dist: bcrypt>=4.0.0
Requires-Dist: fastapi>=0.115.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: orjson>=3.9.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: python-multipart>=0.0.12
Requires-Dist: sqlmodel>=0.0.22
Requires-Dist: uvicorn[standard]>=0.32.0
Provides-Extra: dev
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: hatchling>=1.25.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: twine>=5.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# ankor

Workflow monitoring and management for FastAPI apps.

`ankor` adds a self-hosted dashboard and run-tracking API to **any FastAPI application**. Decorate Python functions with `@gtm.workflow` and choose how they are triggered: manually, on a schedule, or via a webhook.

## Install

```bash
pip install ankor

# Required for scheduled workflows:
pip install apscheduler
```

## Quick start

```python
import os
from fastapi import FastAPI
from ankor import ankor

app = FastAPI()

gtm = ankor(
    app,
    db_url=os.environ["GTM_DB_URL"],
    secret=os.environ["GTM_SECRET"],
)

@gtm.workflow
async def enrich_leads(inputs: dict):
    results = call_some_api(inputs["leads"])
    return {"enriched": results}

@gtm.workflow(schedule="0 9 * * 1-5")
async def daily_sync(inputs: dict):
    return {"synced": sync_database()}

@gtm.workflow(webhook=True)
async def process_event(inputs: dict):
    return handle(inputs)
```

This mounts the dashboard at `/admin/` and the REST API at `/api/*` on your FastAPI app. See [docs/DOCS.md](../docs/DOCS.md) for the full reference — constructor options, workflow decorator options, nodes, config store, data tables (including row filtering with `RowFilter`, column selection, and ordering with `OrderBy`), and deployment.

## API Routes

See [docs/API-ROUTES.md](docs/API-ROUTES.md) for the full route reference.

## Package structure

See [docs/PACKAGE-STRUCTURE.md](docs/PACKAGE-STRUCTURE.md) for the full source layout.

> Additional docs live in [`api/docs/`](docs/).

## Local development

For first-time setup (dependencies, `.env`, migrations) see the [repo root README](../README.md).

```bash
uv run python seed.py   # Optional: seed demo data
```

For dev server commands see the repo root [README.md](../README.md).

## Requirements

- Python 3.11+
- PostgreSQL database (Supabase, Neon, or self-hosted)
- FastAPI app
