Who it is forA developer or analyst building a document workflow that needs to know where each piece of text sits on the page.
The problemPlain text loses the position and type of each line, so downstream code cannot find tables, headers, or form fields.
The outcomeA JSON file per input with lines, boxes, layout blocks, confidences, and timings that a script can parse.
What you need first
- Python 3.10 or newer (the README says it is tested on Linux and macOS)
- pip to install the indra-ocr package
- An internet connection for the first run, which downloads about 76 MB of models from Hugging Face
- The PDFs or images to read
Steps
- Run
pip install indra-ocr. - Run
indra-ocr scan.png --format jsonon one image to see the output shape. - Read the fields in the output: lines with box and confidence, and blocks with label, bbox, and text.
- Write a short script that loads the JSON and filters blocks by label such as Table, Form, or Section-Header.
- Run the same command on a PDF with
indra-ocr paper.pdf --format jsononce the shape is clear. (inferred, check the README)
Prompt for your agent
Using the repo datalab-to/indra, install indra-ocr and run `indra-ocr <input-file> --format json` on <input-file>. Expected output: JSON with lines (box, text, confidence) and blocks (label, bbox, text) per page. Verify that the block labels in the output match the labels listed in the README, such as Text, Table, and Form.
Caveat. The README gives the field names, but the exact JSON structure should be confirmed on your own file before a script depends on it.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page