{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "datalab-to-indra--ocr-to-json-with-boxes-for-a-pipeline",
 "repo": "datalab-to/indra",
 "repo_url": "https://github.com/datalab-to/indra",
 "repo_slug": "datalab-to-indra",
 "title": "Get OCR lines and boxes as JSON for a data pipeline",
 "page_title": "How to get OCR lines and boxes as JSON for a data pipeline with Indra",
 "summary": "Extract each line with its box, confidence, and layout label as JSON.",
 "who": "A developer or analyst building a document workflow that needs to know where each piece of text sits on the page.",
 "problem": "Plain text loses the position and type of each line, so downstream code cannot find tables, headers, or form fields.",
 "outcome": "A JSON file per input with lines, boxes, layout blocks, confidences, and timings that a script can parse.",
 "steps": [
  "Run `pip install indra-ocr`.",
  "Run `indra-ocr scan.png --format json` on 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 json` once the shape is clear. (inferred, check the README)"
 ],
 "agent_prompt": "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.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "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.",
 "category": "Research",
 "tags": [
  "Research"
 ],
 "lang": "python",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/datalab-to-indra/ocr-to-json-with-boxes-for-a-pipeline/",
 "md": "https://dedupedai.com/use-cases/datalab-to-indra/ocr-to-json-with-boxes-for-a-pipeline/index.md",
 "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 hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/datalab-to-indra--ocr-to-json-with-boxes-for-a-pipeline.json",
 "api_version": "v1"
}
