A small build with a way to check it
A PDF becomes checkable data
Extract three invoice fields with a page number and exact supporting text. Missing or conflicting values stay unresolved instead of becoming guesses.
What goes in. What comes out.
- Input
- One synthetic, text-based invoice. No customer data.
- Output
- JSON containing invoiceId, currency and totalDue, each with evidence.
- You need
- A supported Python environment and pypdf. No model or API key.
Build it
- Download build.py and the sample invoice into the same folder.
- Install pypdf in an isolated Python environment and run the command.
- Open result.json beside the invoice. Confirm EDNA-DEMO-1042, NZD and 1380.00, including the evidence quotes.
python -m pip install pypdf
python build.py documents --input sample-invoice.pdf --output result.jsonRun scripts only after reading them. Use an isolated environment. These examples do not install models, send mail or change business records.
Check the result
- Every value has a source page and quote.
- Missing fields return null; duplicate matches are flagged.
- Scanned pages stop with an OCR message instead of silently succeeding.