oneocrCookbook
oneocr cookbook
Short recipes for common OneOcr tasks, each with complete code you can copy.
Recipes
Invoices as fieldsRead an invoice image into typed fields with their EN 16931 business-term ids, line items included, and see which words and box each value came from.ReceiptsRead a till receipt into merchant, date, time, totals, payment method and items, each with the words it was read from.Save and load the page as JSONWrite a page to oneocr.page JSON, the documented and versioned format, and read it back under limits.Words to checkUse calibrated confidence to find the words a person should look at, on a grainy, tilted copy of the receipt.Same bytes on every machineCheck that the text, boxes and confidences don’t depend on the thread count or the CPU’s vector instructions.PDF pagesRead a PDF whose page has both real text and a scanned image: the text layer is used where it exists, the image is read with OCR, and every word says which.The oneocr command lineRead images from a shell or a script with the oneocr tool: text to stdout, or a folder of pages to .txt and .page.json files.