Annex IV-as-Code CLI: generate & validate EU AI Act Annex IV
Project description
Annex IV‑as‑Code (annex4ac)
Generate and validate EU AI Act Annex IV technical documentation straight from your CI.
100% local by default.
SaaS/PDF in the Pro tier.
✨ Features
- Always up‑to‑date – fetches the latest Annex IV text from the AI Act Explorer every run.
- Schema‑first – YAML skeleton mirrors the 13 required sections.
- Fail‑fast CI – exits 1 when mandatory fields are missing.
- Freemium –
fetch_schema&validateare free;generate(PDF) unlocks with a licence key. - One‑line GitHub Action – block pull requests that break compliance.
🚀 Quick‑start
# 1 Install (Python 3.9+)
pip install annex4ac
# 2 Pull the latest Annex IV layout
annex4ac fetch_schema -o annex_template.yaml
# 3 Fill in the YAML → validate
cp annex_template.yaml my_annex.yaml
$EDITOR my_annex.yaml
annex4ac validate -i my_annex.yaml # "Validation OK!" or exit 1
# 4 (Pro) Generate the PDF
echo "ANNEX4AC_LICENSE=your_key" >> ~/.bashrc
annex4ac generate -i my_annex.yaml -o docs/annex_iv.pdf
Hint : You only need to edit the YAML once per model version—CI keeps it green.
🗂 Required YAML fields
| Key | Corresponds to Annex IV § |
|---|---|
system_overview |
1 «General description» |
intended_purpose |
2 |
system_architecture |
3 |
development_process |
4 |
data_specifications |
5 |
performance_metrics |
6 |
risk_management |
7 |
post_market_plan |
8 (only high‑risk) |
human_machine_interface |
9 |
changes_and_versions |
10 |
records_and_logs |
11 |
instructions_for_use |
12 |
compliance_declaration |
13 |
🛠 Commands
| Command | What it does |
|---|---|
fetch_schema |
Download current Annex IV HTML, convert to YAML scaffold annex_schema.yaml. |
validate |
Validate your YAML against the Pydantic schema & Rego rules. Exits 1 on error. |
generate |
Render PDF via Jinja2 → XeLaTeX (Pro). |
Run annex4ac --help for details.
🐙 GitHub Action example
name: Annex IV gate
on: [pull_request]
jobs:
ai-act-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install annex4ac
- run: annex4ac validate -i spec/model.yaml
To use the Pro license in CI, add ANNEX4AC_LICENSE as an encrypted repository secret.
⚙️ Local development
git clone https://github.com/your‑org/annex4ac
cd annex4ac
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
pytest # unit and opa tests
python annex4ac.py --help
TinyTeX (Linux/Mac)
curl -sL https://yihui.org/tinytex/install-unx.sh | sh
export PATH="$HOME/.TinyTeX/bin/x86_64-linux:$PATH"
🔑 Licensing & pricing
- Community (free) – validate in CI, unlimited public repos.
- Pro €15/mo – PDF generation, version history (SaaS), email support.
- Enterprise – self‑hosted Docker, SLA 99.9 %, custom sections.
Pay once, use anywhere: CLI, GitHub Action, REST (coming soon).
📚 References
- Annex IV HTML – https://artificialintelligenceact.eu/annex/4/
- Official Journal PDF – https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=OJ:L_202401689
- Typer docs – https://typer.tiangolo.com
- Pydantic docs – https://docs.pydantic.dev
- Open Policy Agent – https://www.openpolicyagent.org
- TinyTeX install – https://yihui.org/tinytex
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file annex4ac-0.2.1.tar.gz.
File metadata
- Download URL: annex4ac-0.2.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08b86bae9331b15c702213202563363495407ba37a9e51977b0f608edfdd022d
|
|
| MD5 |
ef64ffe9824521f4ddfcbe0906d1b3b7
|
|
| BLAKE2b-256 |
8c2ff1b45cb1c047aa41e5edaa0f6bb38ad6740b4be51c232054c8c7431a2a59
|
File details
Details for the file annex4ac-0.2.1-py3-none-any.whl.
File metadata
- Download URL: annex4ac-0.2.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2a5237b48a3cf65b82d056923f7c4ff3224a1fb4bd47398ee5f9d4fe817eb6e
|
|
| MD5 |
c0d1db19cc703d81b815a3bc8ee1990f
|
|
| BLAKE2b-256 |
c01fa73f2ef773ec1be38c0ae3afa34ca3fe68e6efc4476bf18f9393e14c9453
|