pyocr-toolkit 0.5.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/CHANGELOG.md +105 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/PKG-INFO +15 -9
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/README.md +14 -8
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/pyproject.toml +1 -1
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/__init__.py +1 -1
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/api.py +274 -7
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/cli.py +30 -9
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/compare.py +656 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/documents.py +169 -25
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/export.py +21 -7
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/extract.py +892 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/jobs.py +3 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/llm/__init__.py +8 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/llm/anthropic_provider.py +42 -3
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/llm/base.py +18 -3
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/llm/gemini_provider.py +5 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/llm/openai_provider.py +19 -1
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/llm/prompts.py +71 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/service.py +275 -12
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/static/common.js +1339 -0
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/static/compare.js +651 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/document.js +82 -11
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/static/leaderboard.js +137 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/styles.css +404 -13
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/workspace.js +74 -15
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/templates/_doctabs.html +17 -0
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/templates/_llm_picker.html +64 -0
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/templates/_section_tabs.html +14 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/base.html +12 -14
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/templates/compare.html +162 -0
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/templates/document.html +141 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/help.html +158 -14
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/templates/home.html +69 -0
- pyocr_toolkit-0.7.0/src/pyocr_toolkit/templates/leaderboard.html +73 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/workspace.html +34 -14
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/workspace_detail.html +1 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/web.py +6 -7
- pyocr_toolkit-0.7.0/tests/test_api.py +281 -0
- pyocr_toolkit-0.7.0/tests/test_core.py +307 -0
- pyocr_toolkit-0.7.0/tests/test_extract.py +466 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/test_providers.py +119 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/test_web.py +21 -2
- pyocr_toolkit-0.5.0/src/pyocr_toolkit/compare.py +0 -142
- pyocr_toolkit-0.5.0/src/pyocr_toolkit/static/common.js +0 -584
- pyocr_toolkit-0.5.0/src/pyocr_toolkit/static/compare.js +0 -160
- pyocr_toolkit-0.5.0/src/pyocr_toolkit/templates/_doctabs.html +0 -14
- pyocr_toolkit-0.5.0/src/pyocr_toolkit/templates/_llm_picker.html +0 -12
- pyocr_toolkit-0.5.0/src/pyocr_toolkit/templates/compare.html +0 -84
- pyocr_toolkit-0.5.0/src/pyocr_toolkit/templates/document.html +0 -138
- pyocr_toolkit-0.5.0/src/pyocr_toolkit/templates/home.html +0 -91
- pyocr_toolkit-0.5.0/tests/test_api.py +0 -124
- pyocr_toolkit-0.5.0/tests/test_core.py +0 -129
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/.env.example +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/.gitignore +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/CONTRIBUTING.md +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/LICENSE +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/README.md +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/HeroDemo.tsx +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/Root.tsx +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/assets.d.ts +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/index.ts +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/motion.tsx +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/scenes/CatchScene.tsx +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/scenes/ColdOpenScene.tsx +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/scenes/MeasureScene.tsx +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/scenes/MontageScene.tsx +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/scenes/OutroScene.tsx +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/scenes/ThreeWaysScene.tsx +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/theme.ts +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/hero-video/src/ui.tsx +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/__main__.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/brands.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/config.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/credentials.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/env.example +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/llm/catalog.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/ocr/__init__.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/ocr/base.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/ocr/cloud.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/ocr/local.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/ocr/tesseract.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/pdftext.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/preprocess.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/search.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/jobs.js +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/library.js +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/logos/README.md +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/logos/claude.svg +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/logos/googlecloud.svg +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/logos/googlegemini.svg +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/logos/mistralai.svg +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/logos/paddlepaddle.svg +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/models.js +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/providers.js +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/reader.js +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/search.js +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/static/workspaces.js +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/_brand.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/_doc_card.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/_icons.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/error.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/jobs.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/library.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/models.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/providers.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/reader.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/search.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/templates/workspaces.html +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/src/pyocr_toolkit/workspaces.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/__init__.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/conftest.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/test_batch.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/test_makefile.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/test_models.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/test_ocr_engines.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/test_pdftext.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/test_preprocess.py +0 -0
- {pyocr_toolkit-0.5.0 → pyocr_toolkit-0.7.0}/tests/test_workspaces.py +0 -0
|
@@ -2,6 +2,111 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.7.0 - 2026-11-28
|
|
6
|
+
|
|
7
|
+
- **Calmer interface, same features.** The top bar has three sections, *Documents* (Workspaces / All files / Leaderboard),
|
|
8
|
+
*Search* and *Settings* (Providers / Models), plus a *Jobs* pill that shows how many extractions are running.
|
|
9
|
+
**Ctrl+K / ⌘K** opens a command palette on every page: jump to any page or document by name, run the current
|
|
10
|
+
document's actions (extract, compare, every export) or search all documents' text. Inside a document, the
|
|
11
|
+
breadcrumb, the view tabs and a new **Extract** button share one row.
|
|
12
|
+
- *Overview*: sources are a simple list (coverage, Read, an export menu); only running or failed jobs are shown;
|
|
13
|
+
the original file, metadata and Delete move to the bottom. Extraction opens in a side panel (the Extract
|
|
14
|
+
button, `x`, or `#extract` in the URL) with engine, model and pages up front and image preprocessing, pages
|
|
15
|
+
per request and re-run under *More options*, whose summary line shows their current values.
|
|
16
|
+
- *Pages* (the page inspector): sources (Native / OCR / LLM) on the left of the text panel and the two views,
|
|
17
|
+
*Diff* and *Columns* (was *Side by side*), on the right; page and zoom controls float over the page image.
|
|
18
|
+
The LLM tab folds provider, model, prompt and image into one line ("Model: demo-vision · Verbatim Change"),
|
|
19
|
+
which opens by itself when the chosen provider isn't configured; Re-run and Delete move to a ⋯ menu, and the
|
|
20
|
+
stored-result picker shows only when the page has more than one result.
|
|
21
|
+
- Fixed: re-running an LLM transcription in the inspector no longer counts it twice in the page list.
|
|
22
|
+
- *Home* and *Compare* drop the explainer text and stat tiles; Compare's case/punctuation options move to an
|
|
23
|
+
Options menu.
|
|
24
|
+
|
|
25
|
+
- **Compare explains its numbers.** A single CER can't tell a dropped umlaut from a wrong invoice total or an invented
|
|
26
|
+
sentence, so the Compare page now also shows:
|
|
27
|
+
- word errors split into **misread / missed / added** (they add up to the word edit distance behind WER), for the
|
|
28
|
+
whole document and per page;
|
|
29
|
+
- **numbers read exactly**: every token with a digit (amounts, dates, IDs) checked on its own, with the wrong ones
|
|
30
|
+
listed (`2,530.54 → 2.530,54`);
|
|
31
|
+
- each page's errors **by kind** (numbers, misread words, accents / ß, case, punctuation, split or joined words,
|
|
32
|
+
missed, added, stray scan marks) and the most common **character confusions** (`0→O`, `m→rn`);
|
|
33
|
+
- **CER as differences are forgiven**: the page's CER with case, punctuation and accents ignored and added text
|
|
34
|
+
dropped, step by step, so you can see how much of it is real misreading.
|
|
35
|
+
The page inspector's compare tab shows the misread / missed / added split and the number check too, and
|
|
36
|
+
`pyocr compare` prints an *OCR numbers* column. API: `errors`, `numbers` and `ladder` on
|
|
37
|
+
`POST /api/documents/{id}/pages/{n}/compare`; `errors` and `numbers` per page and in `overall` on
|
|
38
|
+
`GET /api/documents/{id}/compare`. Existing fields are unchanged.
|
|
39
|
+
- **Compare all sources at once.** The Compare page has a new *All sources* mode: tick three or more sources and
|
|
40
|
+
they are voted word by word into a **consensus**, so no source has to be assumed right. Each source is scored
|
|
41
|
+
against the consensus (CER, WER, misread / missed / added, numbers), with a sources × pages grid, the consensus
|
|
42
|
+
text showing every disputed word with its vote count and what the other sources read (close calls, where no
|
|
43
|
+
reading has a majority, in amber; "only lines that disagree" hides the rest), a copy button, and a matrix of how
|
|
44
|
+
much each pair of sources agrees. Sources with no text on a page don't vote there, and pages with only two voters
|
|
45
|
+
are flagged, since two readings can't outvote each other. API: `GET /api/documents/{id}/consensus` and
|
|
46
|
+
`GET /api/documents/{id}/pages/{n}/consensus` (`?sources=` 2–8 ids).
|
|
47
|
+
- **Review & correct.** On the consensus page view, *Review & correct* puts the page image next to the text: click a
|
|
48
|
+
word to see it highlighted on the image and every source's reading of it, pick the right one or type your own, and
|
|
49
|
+
the next close call is selected. *Save corrected text* stores the page as a new **Corrected** source (ground
|
|
50
|
+
truth): it can be exported, read on *Full text*, and becomes the default reference in two-source mode. Stored in
|
|
51
|
+
`corrected/<page>.json` in the document's folder; existing folders are unaffected. API:
|
|
52
|
+
`GET/PUT/DELETE /api/documents/{id}/pages/{n}/corrected`; the page consensus adds a word `box` per column (from
|
|
53
|
+
native text or OCR), `page_size` and the page's `corrected` state.
|
|
54
|
+
- **WER in any order** (order-free WER): the texts compared as bags of words, so words read in a different order
|
|
55
|
+
(columns read across, table rows or side notes in another sequence) aren't counted as errors. The gap to WER is
|
|
56
|
+
the cost of reading order alone. Shown next to WER on the Compare page (whole document, per page, in the table),
|
|
57
|
+
in the inspector, on consensus source cards and as a Leaderboard column. When most of a page's word error is
|
|
58
|
+
reading order, the page's breakdown says so, and the number check reports how many numbers are present at another
|
|
59
|
+
position. API: `wer_order_free`, `word_distance_order_free`, `words_missing` and `words_extra` in every `metrics`
|
|
60
|
+
(`score()`); `wer_order_free` in document `overall`, consensus `overall` and leaderboard entries; `present` in
|
|
61
|
+
`numbers`.
|
|
62
|
+
- **Leaderboard** (new page, `/leaderboard`, also linked from each workspace): every OCR engine, LLM run and PDF
|
|
63
|
+
library ranked across the whole library or one workspace, with CER and WER, misread / missed / added, numbers read
|
|
64
|
+
exactly, pages scored, and for LLM runs cost per page at catalog list price and model time per page; sortable, with
|
|
65
|
+
a sources × documents grid. Each page is scored against corrected text where it has it (real accuracy), otherwise
|
|
66
|
+
the consensus of three or more independent sources (agreement: the page says so); *Score against* can force either.
|
|
67
|
+
*Only pages every source has read* compares like for like. Extraction runs and corrected text aren't ranked.
|
|
68
|
+
API: `GET /api/leaderboard?workspace=&reference=auto|corrected|consensus&shared=`.
|
|
69
|
+
- Faster Overview for large documents: per-page facts (size, text-layer characters, images) are computed once and
|
|
70
|
+
saved to `pages.json` in the document folder, so later visits to a 2,000-page PDF's Overview drop from ~2.5 s
|
|
71
|
+
to ~40 ms. Uploads build `pages.json` in the background right away, so the first visit is fast too, and page
|
|
72
|
+
renders keep working while it runs. The page grid draws thumbnails in batches of 200 as you scroll. Existing
|
|
73
|
+
folders (and documents added with `pyocr add`) get `pages.json` on first view; it is derived data and is rebuilt
|
|
74
|
+
if missing or damaged.
|
|
75
|
+
- No new settings, and LLM prompts and cache keys are unchanged, so existing results stay valid.
|
|
76
|
+
|
|
77
|
+
## 0.6.0 - 2026-11-27
|
|
78
|
+
|
|
79
|
+
- **Structured data extraction**: a new prompt, *Structured data (fields → JSON)*, fills a JSON Schema from each page
|
|
80
|
+
instead of transcribing it. Built-in schemas for invoices, receipts and form fields, or your own JSON Schema
|
|
81
|
+
(checked as you type). Providers enforce the schema natively where they can (Claude structured outputs, OpenAI /
|
|
82
|
+
Azure strict `response_format`, Gemini `response_json_schema`); older Claude models and OpenAI-compatible servers
|
|
83
|
+
get it in the prompt, with a warning. Values are copied as printed, and fields that aren't on the page are `null`.
|
|
84
|
+
The LLM tab shows the result as a field table (fields found, line items, schema problems on their field) with the
|
|
85
|
+
raw JSON one click away. Every reply is parsed and validated against the schema; results store `data`,
|
|
86
|
+
`data_errors`, `fields_filled` and `fields_total` next to the text.
|
|
87
|
+
- **Schema editor**: build your own schema field by field (name, type, hint for the model, required; tables and
|
|
88
|
+
groups nest) without writing JSON Schema, or edit it as JSON in an editor with colours, line numbers and the
|
|
89
|
+
error line marked. *Fix syntax* repairs quotes, unquoted keys, missing or trailing commas, unclosed brackets,
|
|
90
|
+
comments, Python `True`/`None` and type names such as `str` or `bool`. Each edit is checked: mistakes come with
|
|
91
|
+
suggestions ("did you mean 'properties'?"), and a note says whether the chosen provider and model enforce the
|
|
92
|
+
schema or only get it in the prompt. An example output, as the field table or as JSON, shows what a result will
|
|
93
|
+
look like before you pay for a run.
|
|
94
|
+
- **Draft fields from plain words**: describe what to extract ("invoice number, date, every line item with its
|
|
95
|
+
amount") and the chosen model drafts the fields, optionally looking at the current page. The draft opens in the
|
|
96
|
+
field editor for review, and *Change my current fields* refines it step by step ("also add the due date"). One
|
|
97
|
+
paid call per draft (tokens and cost shown), through `LLM_CONCURRENCY`. API: `POST /api/extract/draft-schema`
|
|
98
|
+
(`description`, `provider`, `model`, optional `current_schema`, `doc_id` and `page`; same-origin only).
|
|
99
|
+
- The schema is part of the LLM cache key, so each schema is its own source. Plain transcriptions keep their
|
|
100
|
+
existing keys, so cached results are unaffected.
|
|
101
|
+
- API: `prompt_mode: "extract"` with `extract_schema` (a preset id or a JSON Schema) on
|
|
102
|
+
`POST /api/documents/{id}/pages/{n}/llm` and in job bodies, `POST /api/extract/check-schema` (validation notes,
|
|
103
|
+
example output, syntax error position and a repaired version; takes an optional `provider` and `model`), `extract_presets` in
|
|
104
|
+
`/api/config`, and a per-page `data` object in JSON / JSONL exports of an extraction (one source, and
|
|
105
|
+
*Export all* as `data: {source_id: fields}`). CLI:
|
|
106
|
+
`pyocr extract --mode extract --schema invoice|receipt|form|<file.json>`.
|
|
107
|
+
- The README and website now install from PyPI (`pipx install pyocr-toolkit`) instead of from GitHub.
|
|
108
|
+
- Existing results and cache keys are unchanged.
|
|
109
|
+
|
|
5
110
|
## 0.5.0 - 2026-11-27
|
|
6
111
|
|
|
7
112
|
- **More OCR engines.** Besides Tesseract: RapidOCR, EasyOCR, PaddleOCR and docTR (local, optional extras such as
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pyocr-toolkit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Inspect and compare PDF/image text extraction - native text, OCR engines (Tesseract, EasyOCR, PaddleOCR, docTR, RapidOCR, Google Vision, Azure, Textract, Mistral) and LLMs (Claude, GPT, Gemini, Azure, local) - in your browser.
|
|
5
5
|
Project-URL: Homepage, https://github.com/utkarsh5026/pyocr
|
|
6
6
|
Project-URL: Issues, https://github.com/utkarsh5026/pyocr/issues
|
|
@@ -361,19 +361,20 @@ choco install tesseract # Windows (or the UB Man
|
|
|
361
361
|
**Option A: pipx** (recommended, installs it as an isolated command):
|
|
362
362
|
|
|
363
363
|
```bash
|
|
364
|
-
pipx install
|
|
364
|
+
pipx install pyocr-toolkit
|
|
365
365
|
```
|
|
366
366
|
|
|
367
367
|
**Option B: pip** in a virtual environment:
|
|
368
368
|
|
|
369
369
|
```bash
|
|
370
370
|
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
371
|
-
pip install
|
|
371
|
+
pip install pyocr-toolkit
|
|
372
372
|
```
|
|
373
373
|
|
|
374
374
|
> [!NOTE]
|
|
375
|
-
> The PyPI name is `pyocr-toolkit` (plain `pyocr` is a different, unrelated library).
|
|
376
|
-
>
|
|
375
|
+
> The PyPI name is `pyocr-toolkit` (plain `pyocr` is a different, unrelated library). Optional extras add more
|
|
376
|
+
> engines, e.g. `pipx install "pyocr-toolkit[pdf,rapidocr]"`. To run the latest unreleased code, install from
|
|
377
|
+
> GitHub instead: `pipx install git+https://github.com/utkarsh5026/pyocr`.
|
|
377
378
|
|
|
378
379
|
**Option C: Docker** (Tesseract and several language packs included):
|
|
379
380
|
|
|
@@ -401,14 +402,16 @@ Everything you upload and extract is stored in `./data` (change it with `DATA_DI
|
|
|
401
402
|
| **Home** `/` | Drop files to upload; see setup status and recent documents. |
|
|
402
403
|
| **Library** `/documents` | Document cards showing native / OCR / LLM coverage and how many pages still have no text. Filter by status, workspace or name; delete. |
|
|
403
404
|
| **Workspaces** `/workspaces` | Named groups of documents. Uploading several files or a `.zip` offers to create one, with suggested names (from the file names, or `adjective-scientist` like `festive-albattani`). Open one to rename it, add files or remove documents. |
|
|
404
|
-
| **Overview** `/documents/{id}` |
|
|
405
|
-
| **
|
|
405
|
+
| **Overview** `/documents/{id}` | Every *source* (engine + model + prompt) with coverage and token usage; read or export it; running jobs; page thumbnails. The **Extract** button in the document header (or `x`) opens a side panel to start background extraction (any OCR engine or LLM) for all pages or a range such as `1-5,9`, typed or picked on a clickable page map; *More options* holds image preprocessing, pages per LLM request and re-running. |
|
|
406
|
+
| **Pages** (page inspector) `/documents/{id}/pages/{n}` | Page image next to native, OCR and LLM text; run OCR or an LLM on just this page; a *Diff* view; a *Columns* view with all three texts in synced columns; search hits drawn on the image; *Adjust* to preprocess the image the LLM receives (filters, fine-tuning, crop/rotate) and A/B it against the original. Keyboard: `←/→`, `/`, `1-5`, `t`, `o`, `e`. |
|
|
406
407
|
| **Full text** `/documents/{id}/text` | Read the whole document from one source, optionally beside the page images; find, copy, download. |
|
|
407
|
-
| **Compare** `/documents/{id}/compare` | Score source B against source A on every page: document-level CER/WER, a clickable CER-per-page chart, and an aligned side-by-side diff of the selected page (opens on the worst page). Works for OCR vs LLM, native vs LLM, or **model vs model**. |
|
|
408
|
+
| **Compare** `/documents/{id}/compare` | Score source B against source A on every page: document-level CER/WER (plus WER in any order, which ignores reading order), word errors split into misread / missed / added, how many numbers (amounts, dates, IDs) were read exactly, a clickable CER-per-page chart, and an aligned side-by-side diff of the selected page with a breakdown of its errors by kind (opens on the worst page). **All sources** votes three or more sources into a word-by-word consensus and scores each against it, so you don't need to know which one is right; close calls are marked for review. **Review & correct** shows the page image next to the text, highlights each disputed word on it, and saves your choices as a *Corrected* source: ground truth to score every engine against. Works for OCR vs LLM, native vs LLM, or **model vs model**. |
|
|
408
409
|
| **Search** `/search` | Search all documents at once. |
|
|
409
410
|
| **Jobs** `/jobs` | All background extractions, with progress, errors and tokens. |
|
|
410
411
|
| **Providers** `/providers` | Which settings are set or missing, a form to set keys/endpoints in the browser, plus a **Test connection** button per provider. |
|
|
411
412
|
| **Models** `/models` | Search a catalog of vision models rated for transcription (excellent / good / fair / not suitable, with price and reason); list the models your key can use and pick one. |
|
|
413
|
+
| **Command palette** `Ctrl+K` / `⌘K` | On every page: open any page or document by name, run the current document's actions (extract, compare, export), or search every document's text. The top bar itself has three sections: Documents (Workspaces, All files, Leaderboard), Search, Settings (Providers, Models). |
|
|
414
|
+
| **Leaderboard** `/leaderboard` | Every OCR engine, LLM run and PDF library ranked across the library or one workspace: CER/WER, misread / missed / added, numbers read exactly, pages scored, cost and time per page. Each page is scored against your corrected text where you reviewed it, otherwise the consensus of three or more sources; *Only pages every source has read* makes it like for like. |
|
|
412
415
|
| **Help** `/help` | The full guide: concepts, metrics, workflows, troubleshooting. |
|
|
413
416
|
| **API docs** `/docs` | Interactive OpenAPI docs for the JSON API. |
|
|
414
417
|
|
|
@@ -485,6 +488,7 @@ pyocr extract born-digital.pdf --engine native # embedded text only
|
|
|
485
488
|
pyocr extract born-digital.pdf --engine native:pypdf # the same text layer as pypdf reads it
|
|
486
489
|
pyocr compare scan.pdf -p openai -m gpt-6.2-sol # per-page OCR / native CER vs an LLM
|
|
487
490
|
pyocr extract scan.pdf -p anthropic --preprocess 'gray;auto;contrast=1.5' # adjust the image first (or a preset: clean, bw, ...)
|
|
491
|
+
pyocr extract invoice.pdf -p anthropic --mode extract --schema invoice --format json # fields, not text (or a JSON Schema file)
|
|
488
492
|
pyocr import a.pdf b.pdf scans.zip folder/ -w invoices # add many files as one workspace (zips unpacked)
|
|
489
493
|
pyocr providers # which providers are ready
|
|
490
494
|
pyocr engines # which OCR engines are ready
|
|
@@ -530,7 +534,9 @@ you ask otherwise.
|
|
|
530
534
|
between two texts. **CER** = edits / reference characters; **WER** is the same count over words. For example,
|
|
531
535
|
"the cat sat" → "the bat sat" has 1 edit, so CER = 1/11 = 9%. Whitespace is normalised first, because line
|
|
532
536
|
breaks aren't reading errors. Disagreement between two engines is not proof of error: compare against a
|
|
533
|
-
born-digital PDF's native text when you need ground truth.
|
|
537
|
+
born-digital PDF's native text when you need ground truth. **WER in any order** compares the texts as bags of
|
|
538
|
+
words, so an engine that reads a two-column page across the columns isn't punished for order alone; the gap
|
|
539
|
+
between it and WER is the cost of reading order.
|
|
534
540
|
|
|
535
541
|
The Help page explains each of these in more depth.
|
|
536
542
|
|
|
@@ -96,19 +96,20 @@ choco install tesseract # Windows (or the UB Man
|
|
|
96
96
|
**Option A: pipx** (recommended, installs it as an isolated command):
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
pipx install
|
|
99
|
+
pipx install pyocr-toolkit
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
**Option B: pip** in a virtual environment:
|
|
103
103
|
|
|
104
104
|
```bash
|
|
105
105
|
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
106
|
-
pip install
|
|
106
|
+
pip install pyocr-toolkit
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
> [!NOTE]
|
|
110
|
-
> The PyPI name is `pyocr-toolkit` (plain `pyocr` is a different, unrelated library).
|
|
111
|
-
>
|
|
110
|
+
> The PyPI name is `pyocr-toolkit` (plain `pyocr` is a different, unrelated library). Optional extras add more
|
|
111
|
+
> engines, e.g. `pipx install "pyocr-toolkit[pdf,rapidocr]"`. To run the latest unreleased code, install from
|
|
112
|
+
> GitHub instead: `pipx install git+https://github.com/utkarsh5026/pyocr`.
|
|
112
113
|
|
|
113
114
|
**Option C: Docker** (Tesseract and several language packs included):
|
|
114
115
|
|
|
@@ -136,14 +137,16 @@ Everything you upload and extract is stored in `./data` (change it with `DATA_DI
|
|
|
136
137
|
| **Home** `/` | Drop files to upload; see setup status and recent documents. |
|
|
137
138
|
| **Library** `/documents` | Document cards showing native / OCR / LLM coverage and how many pages still have no text. Filter by status, workspace or name; delete. |
|
|
138
139
|
| **Workspaces** `/workspaces` | Named groups of documents. Uploading several files or a `.zip` offers to create one, with suggested names (from the file names, or `adjective-scientist` like `festive-albattani`). Open one to rename it, add files or remove documents. |
|
|
139
|
-
| **Overview** `/documents/{id}` |
|
|
140
|
-
| **
|
|
140
|
+
| **Overview** `/documents/{id}` | Every *source* (engine + model + prompt) with coverage and token usage; read or export it; running jobs; page thumbnails. The **Extract** button in the document header (or `x`) opens a side panel to start background extraction (any OCR engine or LLM) for all pages or a range such as `1-5,9`, typed or picked on a clickable page map; *More options* holds image preprocessing, pages per LLM request and re-running. |
|
|
141
|
+
| **Pages** (page inspector) `/documents/{id}/pages/{n}` | Page image next to native, OCR and LLM text; run OCR or an LLM on just this page; a *Diff* view; a *Columns* view with all three texts in synced columns; search hits drawn on the image; *Adjust* to preprocess the image the LLM receives (filters, fine-tuning, crop/rotate) and A/B it against the original. Keyboard: `←/→`, `/`, `1-5`, `t`, `o`, `e`. |
|
|
141
142
|
| **Full text** `/documents/{id}/text` | Read the whole document from one source, optionally beside the page images; find, copy, download. |
|
|
142
|
-
| **Compare** `/documents/{id}/compare` | Score source B against source A on every page: document-level CER/WER, a clickable CER-per-page chart, and an aligned side-by-side diff of the selected page (opens on the worst page). Works for OCR vs LLM, native vs LLM, or **model vs model**. |
|
|
143
|
+
| **Compare** `/documents/{id}/compare` | Score source B against source A on every page: document-level CER/WER (plus WER in any order, which ignores reading order), word errors split into misread / missed / added, how many numbers (amounts, dates, IDs) were read exactly, a clickable CER-per-page chart, and an aligned side-by-side diff of the selected page with a breakdown of its errors by kind (opens on the worst page). **All sources** votes three or more sources into a word-by-word consensus and scores each against it, so you don't need to know which one is right; close calls are marked for review. **Review & correct** shows the page image next to the text, highlights each disputed word on it, and saves your choices as a *Corrected* source: ground truth to score every engine against. Works for OCR vs LLM, native vs LLM, or **model vs model**. |
|
|
143
144
|
| **Search** `/search` | Search all documents at once. |
|
|
144
145
|
| **Jobs** `/jobs` | All background extractions, with progress, errors and tokens. |
|
|
145
146
|
| **Providers** `/providers` | Which settings are set or missing, a form to set keys/endpoints in the browser, plus a **Test connection** button per provider. |
|
|
146
147
|
| **Models** `/models` | Search a catalog of vision models rated for transcription (excellent / good / fair / not suitable, with price and reason); list the models your key can use and pick one. |
|
|
148
|
+
| **Command palette** `Ctrl+K` / `⌘K` | On every page: open any page or document by name, run the current document's actions (extract, compare, export), or search every document's text. The top bar itself has three sections: Documents (Workspaces, All files, Leaderboard), Search, Settings (Providers, Models). |
|
|
149
|
+
| **Leaderboard** `/leaderboard` | Every OCR engine, LLM run and PDF library ranked across the library or one workspace: CER/WER, misread / missed / added, numbers read exactly, pages scored, cost and time per page. Each page is scored against your corrected text where you reviewed it, otherwise the consensus of three or more sources; *Only pages every source has read* makes it like for like. |
|
|
147
150
|
| **Help** `/help` | The full guide: concepts, metrics, workflows, troubleshooting. |
|
|
148
151
|
| **API docs** `/docs` | Interactive OpenAPI docs for the JSON API. |
|
|
149
152
|
|
|
@@ -220,6 +223,7 @@ pyocr extract born-digital.pdf --engine native # embedded text only
|
|
|
220
223
|
pyocr extract born-digital.pdf --engine native:pypdf # the same text layer as pypdf reads it
|
|
221
224
|
pyocr compare scan.pdf -p openai -m gpt-6.2-sol # per-page OCR / native CER vs an LLM
|
|
222
225
|
pyocr extract scan.pdf -p anthropic --preprocess 'gray;auto;contrast=1.5' # adjust the image first (or a preset: clean, bw, ...)
|
|
226
|
+
pyocr extract invoice.pdf -p anthropic --mode extract --schema invoice --format json # fields, not text (or a JSON Schema file)
|
|
223
227
|
pyocr import a.pdf b.pdf scans.zip folder/ -w invoices # add many files as one workspace (zips unpacked)
|
|
224
228
|
pyocr providers # which providers are ready
|
|
225
229
|
pyocr engines # which OCR engines are ready
|
|
@@ -265,7 +269,9 @@ you ask otherwise.
|
|
|
265
269
|
between two texts. **CER** = edits / reference characters; **WER** is the same count over words. For example,
|
|
266
270
|
"the cat sat" → "the bat sat" has 1 edit, so CER = 1/11 = 9%. Whitespace is normalised first, because line
|
|
267
271
|
breaks aren't reading errors. Disagreement between two engines is not proof of error: compare against a
|
|
268
|
-
born-digital PDF's native text when you need ground truth.
|
|
272
|
+
born-digital PDF's native text when you need ground truth. **WER in any order** compares the texts as bags of
|
|
273
|
+
words, so an engine that reads a two-column page across the columns isn't punished for order alone; the gap
|
|
274
|
+
between it and WER is the cost of reading order.
|
|
269
275
|
|
|
270
276
|
The Help page explains each of these in more depth.
|
|
271
277
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyocr-toolkit"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.7.0"
|
|
4
4
|
description = "Inspect and compare PDF/image text extraction - native text, OCR engines (Tesseract, EasyOCR, PaddleOCR, docTR, RapidOCR, Google Vision, Azure, Textract, Mistral) and LLMs (Claude, GPT, Gemini, Azure, local) - in your browser."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|