Metadata-Version: 2.4
Name: daap-cli
Version: 0.4.0
Summary: CLI for data-product design artifacts - scaffold, lint, and export ODCS data contracts
Author-email: DaaP Enablement Pod <daap-enablement@tyme.com>
License: Proprietary
Keywords: daap,data-product,data-contract,odcs,yaml,lint
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pyyaml>=6
Requires-Dist: jsonschema>=4.18

# daap — a CLI for data-product design artifacts

`daap` is file tooling for authoring data-product design artifacts:
`model_spec.yml` (the canonical modelling declaration) and ODCS-style data
contracts. Scaffold them, shape-check them, and generate contracts from the
model spec — so the structure is never hand-authored twice.

## Install

```bash
uv tool install daap-cli        # recommended — isolated, fast
pipx install daap-cli           # same idea
pip install daap-cli            # classic
```

## Commands

| Command | What it does |
|---|---|
| `daap init [DIR]`    | scaffold a starter `model_spec.yml` |
| `daap lint [DIR]`    | validate artifact shape against the bundled JSON Schemas |
| `daap export [DIR]`  | generate ODCS data-contract file(s) from `model_spec.yml` |
| `daap doctor`        | show the CLI version and where the schemas come from |

`lint` and `doctor` take `--json` for scripts/CI.
Exit codes: `0` ok · `2` validation/usage error — pre-commit friendly.

## Typical workflow

```bash
daap init my_product/            # start from the template
vi my_product/model_spec.yml     # design your model (conceptual → logical → physical)
daap lint my_product/            # instant shape feedback while editing
daap export my_product/          # project the physical models into ODCS contracts
daap lint my_product/            # contracts are shape-checked too
```

`export` treats `model_spec.yml` as canonical: contract fields come from the
referenced logical models, the declared grain is projected as custom
properties, and history-grain models get standard SCD2 columns
(`valid_from` / `valid_to` / `is_current`). Regenerate instead of hand-editing
contract structure.

## What it checks

`daap lint` validates shape only — required fields, types, structure — against
the JSON Schemas packaged with the CLI:

* `model_spec.yml` — conceptual / logical / physical models, grain declaration
* `contracts/*.odcs.yml` — ODCS-style contract structure and fields
* `manifest.yml` — product envelope structure (when present)

Organisation-specific governance (approval gates, naming boards, etc.) is out
of scope for this tool — it runs wherever your platform runs it.

## Development

```bash
git clone <repo> && pip install -e cli/   # repo schemas win over packaged ones
python3 cli/build_assets.py               # bake schemas for a distribution build
python -m build cli                       # wheel + sdist
```

Releases: CI builds, smoke-tests in a clean venv, publishes to TestPyPI
(`TESTPYPI_API_TOKEN`), then PyPI (`PUBLISH_PYPI=true` + `PYPI_API_TOKEN`).
Bump `version` in `cli/pyproject.toml` to release; `--skip-existing` keeps
re-runs harmless.
