Metadata-Version: 2.4
Name: ankor
Version: 0.5.102
Summary: Workflow monitoring and management for FastAPI apps
License: MIT License
        
        Copyright (c) 2025 ankor
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
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: 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
