Metadata-Version: 2.4
Name: xtremedp-airframe
Version: 0.1.0
Summary: Airflow DAG generator CLI — scaffold, templates, and deployment in one tool
Project-URL: Homepage, https://github.com/ochsec/airframe
Project-URL: Source, https://github.com/ochsec/airframe
Project-URL: Documentation, https://xtremedp.com
Author: OpenLife
License: MIT
Keywords: airflow,dag,data-engineering,etl,generator
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.11
Requires-Dist: jinja2>=3.1
Requires-Dist: pydantic>=2.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: pyright>=1.1; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# Airframe

**Generate production-ready Airflow DAGs from battle-tested templates.**

Airframe is a CLI tool that generates complete, deployable Airflow DAGs from
Jinja2 templates — not just code skeletons, but the full working system with
connections, retry policies, observability hooks, and optional Terraform
infrastructure for self-hosted Airflow on Linode.

## Quick Start

```bash
pip install xtremedp-airframe

# Initialize a project
airframe init

# Generate a DAG from a template
airframe generate postgres-cdc --dag-id orders_cdc --table orders --schedule "@hourly"

# List available templates
airframe list-templates

# Deploy Airflow infrastructure (requires Terraform + Linode token)
airframe deploy

# Check version and environment
airframe version
airframe info
```

## Commands

### `airframe init`
Scaffolds a new airframe project in the current directory:
- `dags/` — generated DAG files
- `tests/` — DAG tests
- `airframe.yaml` — project configuration
- `.gitignore`

### `airframe generate <template>`
Generates a DAG file from a template. Reads defaults from `airframe.yaml`,
overrides with CLI flags:

```bash
airframe generate postgres-cdc \
  --dag-id orders_cdc \
  --table orders \
  --schedule "@hourly" \
  --batch-size 2000 \
  --source-conn source_postgres \
  --warehouse-conn warehouse_conn
```

### `airframe list-templates`
Shows available templates with pricing.

### `airframe deploy`
Runs Terraform to deploy self-hosted Airflow on Linode. Requires Terraform
installed and Linode API token configured.

### `airframe version`
Prints the installed airframe version.

### `airframe info`
Shows version, Python version, project config (if `airframe.yaml` exists),
and available templates with pricing.

## Examples

See the `examples/` directory for generated DAGs from every template:

```bash
airframe generate data-quality --dag-id dq_validation
airframe generate postgres-cdc --dag-id orders_cdc --table orders
airframe generate api-to-warehouse --dag-id orders_api_sync --endpoint /api/v1/orders
```

## Templates

| Template | Description | Price |
|----------|-------------|-------|
| `data-quality` | Standalone DQ validation: row count, null, uniqueness, completeness | Free |
| `file-batch-ingest` | S3/file batch ingest → warehouse with upsert + validation | $29 |
| `postgres-cdc` | Postgres CDC → warehouse (Centene pattern) | $49 |
| `api-to-warehouse` | REST API → warehouse with pagination + upsert | $99 |
| `multi-source-elt` | Multi-source ELT: Postgres CDC + API → merge → transform → warehouse | $149 |
| `dbt-runner` | dbt transformation pipeline: deps → freshness → run → test → docs | $99 |
| *More coming soon* | | |

## Configuration

`airframe.yaml` stores project defaults:

```yaml
project_name: my-pipelines
owner: airframe
schedule: "@daily"
start_date: "2025-01-01"
catchup: false
retries: 1
retry_delay_minutes: 5
tags:
  - airframe
output_dir: dags
```

## Development

```bash
git clone <repo-url>
cd airframe
uv pip install -e ".[dev]"
pytest
```

## Architecture

```
src/airframe/
├── cli/main.py          — Typer CLI (init, generate, list-templates, deploy)
├── config.py            — ProjectConfig (Pydantic, airframe.yaml schema)
├── templates/
│   ├── __init__.py      — TemplateConfig, render_template(), template registry
│   ├── data_quality.py.j2 — Standalone DQ validation template (Free)
│   ├── file_batch_ingest.py.j2  — S3 batch ingest template ($29)
│   ├── postgres_cdc.py.j2  — Postgres CDC DAG template ($49)
│   ├── api_to_warehouse.py.j2  — REST API → warehouse template ($99)
│   ├── multi_source_elt.py.j2  — Multi-source ELT template ($149)
│   └── dag_test.py.j2   — Generated DAG test template
terraform/airflow/
├── main.tf              — Linode instance, firewall, DNS
├── variables.tf         — Configurable inputs
├── outputs.tf           — Airflow URL, IP, SSH command
└── install.sh           — StackScript provisioning
```

## License

The CLI and free data-quality template are MIT-licensed. Paid template
packs are sold separately under a commercial license — see
[MARKETING.md](MARKETING.md) for purchasing.