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.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for datalab-to/indra and "Get OCR lines and boxes as JSON for a data pipeline"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer