Metadata-Version: 2.4
Name: strata-lang
Version: 0.1.1
Summary: Strata — declarative, versioned, immutable data transformations (compiles to SQL)
Author-email: Strata <hello@strata-lang.org>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Tzinny-dev/strata
Project-URL: Repository, https://github.com/Tzinny-dev/strata
Project-URL: Issues, https://github.com/Tzinny-dev/strata/issues
Keywords: sql,data-engineering,dbt,duckdb,data-contracts,lineage
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Intended Audience :: Developers
Classifier: Topic :: Database
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: duckdb>=1.0
Requires-Dist: PyYAML>=6.0
Provides-Extra: postgres
Requires-Dist: psycopg2-binary>=2.9; extra == "postgres"
Provides-Extra: bigquery
Requires-Dist: google-cloud-bigquery>=3.0; extra == "bigquery"
Provides-Extra: snowflake
Requires-Dist: snowflake-connector-python>=3.0; extra == "snowflake"
Provides-Extra: airflow
Requires-Dist: apache-airflow>=2.8; extra == "airflow"
Provides-Extra: prefect
Requires-Dist: prefect>=2.14; extra == "prefect"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: coverage>=7.0; extra == "dev"
Requires-Dist: psycopg2-binary>=2.9; extra == "dev"
Provides-Extra: all
Requires-Dist: psycopg2-binary>=2.9; extra == "all"
Requires-Dist: google-cloud-bigquery>=3.0; extra == "all"
Requires-Dist: snowflake-connector-python>=3.0; extra == "all"
Requires-Dist: apache-airflow>=2.8; extra == "all"
Requires-Dist: prefect>=2.14; extra == "all"
Dynamic: license-file

# Strata — prototype

Declarative, versioned, immutable data transformations. Compiles to SQL (DuckDB/Postgres/BigQuery/Snowflake), with column-level lineage and 3-phase contract pins.

> Working title v0.1 — prototype lives in `prototype/`. Spec in `../spec/`.

## Install (dev)

```bash
cd prototype
python -m venv .venv
.venv/bin/pip install -e ".[dev]"
strata --help
```

Or without venv after publish:

```bash
pip install strata-lang
strata --help
```

### uv (standalone tool, no venv)

```bash
# from PyPI (once published) — package is strata-lang, entry point stays `strata`
uv tool install strata-lang
strata --help

# from Git (before PyPI, or dev)
uv tool install git+https://github.com/Tzinny-dev/strata --from prototype
strata --help

# upgrade
uv tool upgrade strata-lang
pip install --upgrade strata-lang
```

## Quick start

```bash
# typecheck + contracts + lineage (no DB)
strata build examples/daily_orders.strata

# emit SQL for a dialect
strata compile examples/daily_orders.strata --dialect postgres

# materialize in DuckDB (with demo fixtures)
strata run examples/daily_orders.strata --seed -o /tmp/demo.duckdb
strata test examples/daily_orders.strata --seed
```

See `docs/getting-started.md` and `docs/tutorial.md` for the full walkthrough (every code block was run against the CLI before writing).

## Warehouses

| Warehouse | SQL emit (`compile --dialect`) | Engine run (`run -o` / `exec`) | Driver |
|---|---|---|---|
| DuckDB | ✅ | ✅ `DuckDBWarehouse` + `dbcompat` (`duckdb` default dep) | `duckdb` |
| Postgres | ✅ | ✅ `cli.open_warehouse("postgres://...")` → `dbcompat.PGConn` (probado vs Postgres 16 efímero) — `adapters.get_adapter("postgres")` sigue stub E095 a propósito | `pip install strata[postgres]` |
| BigQuery | ✅ | ❌ stub E095 | `pip install strata[bigquery]` |
| Snowflake | ✅ | ❌ stub E095 | `pip install strata[snowflake]` |

## Experimental modules

| Module | Status | Notes |
|---|---|---|
| `strata.integrations` | scaffolding only | `airflow_dag_factory`/`prefect_flow_factory` return *strings* of Python source; `airflow`/`prefect` not installed by default (`pip install strata[airflow]` / `[prefect]`). No real DAG/flow is instantiated — see `plan-hito-2.md` §B. |
| `strata.testing` | fixture helpers only | `create_test_source`/`FreshnessTestHelper` emit `.strata` text or temp tables; not wired to the executor for e2e. Use `strata.exec` for real freshness gates. |
| `strata.observability` | connected | `MetricsCollector` is imported by `strata.exec._run_locked` and exposed via `get_metrics()`; exporters are formatters (Prometheus/StatsD/JSON) without external deps. |

## Docker

```bash
# from GHCR (after tag push v0.1.0 triggers docker.yml)
docker pull ghcr.io/tzinny-dev/strata:0.1.0
docker run --rm ghcr.io/tzinny-dev/strata:0.1.0 --help
docker run --rm -v $PWD:/work -w /work ghcr.io/tzinny-dev/strata:0.1.0 build examples/daily_orders.strata
docker run --rm -v $PWD:/work -w /work ghcr.io/tzinny-dev/strata:0.1.0 run examples/daily_orders.strata --seed -o /tmp/demo.duckdb

# local build (no docker daemon required on host for CI build via GHA)
docker build -t ghcr.io/tzinny-dev/strata:0.1.0 -f Dockerfile .
```

## Development

```bash
.venv/bin/pytest -q
.venv/bin/pytest --cov=strata --cov-fail-under=80
```

Coverage gate: 80% (`pyproject.toml` / `pytest.ini`).
