docstrange — document data extraction

★ 1.6K

NanoNets/docstrange is an open-source Python library that converts documents — PDFs, scans, phone photos, DOCX, PPTX, XLSX, and URLs — into clean Markdown, JSON, CSV, or HTML. Reach for it when you need to turn a stack of invoices or contracts into a spreadsheet without retyping; when documents arrive as scans or photos that ordinary parsers can't handle; when preparing content for an LLM or RAG pipeline and you need structured, LLM-optimized Markdown; or when you need to extract specific fields using a JSON schema rather than dumping raw text. Under the hood it chains OCR, layout detection, and a 7B document-understanding model, preserving tables and sections while stripping page artifacts. Built on Python ≥ 3.8 and installed via pip. Two processing modes: a free cloud API (up to 10,000 documents per month) and a fully local mode running on GPU or CPU with no data leaving your machine. Includes a built-in local web UI with drag-and-drop and an MCP server for Claude Desktop integration. The direction is document data extraction and structuring, not text generation or editing — unlike orchestration frameworks such as LangChain, docstrange is a ready-to-use parsing pipeline, not a framework you assemble yourself. Works well for privacy-sensitive document processing and AI data prep; results on handwritten text should be reviewed manually.