Metadata-Version: 2.4
Name: specreq
Version: 0.2.0
Summary: Define requirements as typed models, compose specs as JSON, validate products.
Author-email: William Hogben <will@willhogben.com>
License-Expression: MIT
Project-URL: Homepage, https://willhogben.com
Project-URL: Repository, https://github.com/whogben/specreq
Project-URL: Changelog, https://github.com/whogben/specreq/blob/main/CHANGELOG.md
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0
Requires-Dist: typer>=0.9
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Dynamic: license-file

# specreq

Define reusable requirements as typed Pydantic models. Compose them into specs as JSON trees. Validate products against them.

See the [Changelog](https://github.com/whogben/specreq/blob/main/CHANGELOG.md) for recent changes.

```
my_project/
  reqs/          # req definitions — gather shared ones, write custom ones
  specs/         # specs — JSON trees of configured req instances
  products/      # built output that specreq validates against your specs
```

1. **Gather reqs** — collect shared requirements and write custom ones by subclassing `Req` with typed fields, a `kind` discriminator, and a `validate(self, product: Path)` method.
2. **Write specs** — compose specs as JSON trees of configured req instances describing what your product should satisfy.
3. **Build, validate, repeat** — run `specreq validate` from the project root.

Req files under `reqs/` are standard Python — flat files are modules, directories with `__init__.py` are packages. Reqs import each other normally.
