02 / OPEN SOURCE · PYTHON LIBRARY
sacor — evidence-first document extraction
Python library and CLI on PyPI (pre-alpha) that extracts fields from Italian electricity and gas bills and CTE documents: every value comes back with its origin, the repairs applied and the invariants checked, and stays null when there is no evidence.
Overview
Python library and CLI on PyPI (pre-alpha) that extracts fields from Italian electricity and gas bills and CTE documents: every value comes back with its origin, the repairs applied and the invariants checked, and stays null when there is no evidence.
The challenge
An extractor that only returns a value asks for trust. The output has to be checkable, and say "I don't know" instead of guessing.
Architecture approach
Tiered pipeline: deterministic extraction, invariant validation, optional AI arbitration, JSON output with computed confidence.
The solution
A deterministic regex tier always runs for free; an optional AI pass handles only unresolved fields, with an explicit cost. Confidence is computed from evidence, and a missing field is null.
Key capabilities
- Evidence attached to every extracted field
- Tracked repairs (decimal comma, dates)
- Arithmetic invariants between related fields
- Optional AI tier with an estimated cost per call
Technology direction
Project scope
The case study describes the project scope and the technical choices. Open-source projects have public code on GitHub; details of confidential projects are available on request.
Next project