Metadata-Version: 2.4
Name: normpare
Version: 0.1.1
Summary: Compare two editions of a technical standard: changes, per-chapter summaries and a synopsis — deterministic, plus optional AI interpretation.
License: MIT
License-File: LICENSE
Keywords: standards,standard,diff,compare,synopsis,regulatory,docx,pdf
Author: Christian Ehlert
Author-email: christian.ehlert@mailbox.org
Requires-Python: >=3.13,<3.14
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Text Processing :: Linguistic
Provides-Extra: anthropic
Provides-Extra: embeddings
Requires-Dist: anthropic (>=0.40,<1.0) ; extra == "anthropic"
Requires-Dist: einops (>=0.8,<0.9) ; extra == "embeddings"
Requires-Dist: lxml (>=5.0,<6.0)
Requires-Dist: numpy (>=2.1,<3.0)
Requires-Dist: pymupdf (>=1.24,<2.0)
Requires-Dist: python-docx (>=1.1,<2.0)
Requires-Dist: python-pptx (>=1.0,<2.0)
Requires-Dist: scipy (>=1.14,<2.0)
Requires-Dist: sentence-transformers (>=3.0,<4.0) ; extra == "embeddings"
Project-URL: Documentation, https://ce1ectric.github.io/normpare/
Project-URL: Homepage, https://github.com/Ce1ectric/normpare
Project-URL: Repository, https://github.com/Ce1ectric/normpare
Description-Content-Type: text/markdown

# normpare

**Find out what actually changed between two editions of a technical standard.**

When a standard is revised, the publisher rarely tells you precisely what changed. You get a
new PDF of several hundred pages and are left to compare it against the old one by hand.
`normpare` does that comparison for you: it reads both editions, matches them chapter by
chapter and paragraph by paragraph, and reports every change — new requirements, deleted
ones, changed limit values, reworded passages, moved sections, edited tables.

The comparison itself is **deterministic**: same inputs, same output, every time, with no AI
involved. On top of that you can optionally switch on an **AI interpretation** that explains
each change in plain language and separates real substantive changes from mere editorial
rewording. Every AI statement carries a verbatim quote from the source, and normpare checks
that the quote really exists — so you can always trace a claim back to the text.

## What you get

- An annotated **HTML** version of the new edition: changes colour-coded in place, with a
  summary per chapter, cell-level table diffs and embedded figures.
- Two **Word synopses** — a deterministic, tabular old ↔ new comparison, and (if AI is on) a
  final, readable one that bundles related changes into a single entry per topic.
- A **PowerPoint** draft of the key changes, machine-readable **JSON** for every stage,
  **tables as CSV**, and figures as image assets.

## Installation

Requires **Python 3.13**.

```bash
pip install normpare                      # deterministic comparison
pip install "normpare[anthropic]"         # + AI interpretation via Anthropic
pip install "normpare[embeddings]"        # + optional embedding-based alignment
```

## Usage

Two files in, one directory out:

```bash
normpare compare --old standard_2019.pdf --new standard_2026.docx --out result/
```

PDF and DOCX are both supported, and mixing them is fine. Without an API key the run is
purely deterministic; the AI prompts are exported so you can paste them into a chat instead.

From Python:

```python
import normpare

result = normpare.compare(
    old="standard_2019.pdf",
    new="standard_2026.docx",
    out_dir="result/",
    use_llm=False,          # True + an API key => AI interpretation
    language="de",          # language the standard is written in
)
print(result.html, result.synopse_det, result.synopse_final)
```

Useful flags: `--no-llm` (deterministic only), `--batch` (send the interpretation as one
Anthropic batch, about half the price), `--model` / `--provider` (choose the AI backend —
Anthropic, OpenAI, a local Ollama server, and others).

## Documentation

Full documentation, including how the pipeline works and how to pick an AI model:
<https://ce1ectric.github.io/normpare/>

## License

[MIT](LICENSE) © 2026 Christian Ehlert

