py-idp
AI-enabled Intelligent Document Processing for Python: 12+ LLM backends, Pydantic schemas, self-hosted OCR (Nanonets-OCR2-3B), auto-schema discovery, HITL revie
What is py-idp?
AI-enabled Intelligent Document Processing for Python: 12+ LLM backends, Pydantic schemas, self-hosted OCR (Nanonets-OCR2-3B), auto-schema discovery, HITL review, prod FastAPI server. AGPL-3.0 + commercial.
Overview of py-idp
What it is
py-idp is a general-purpose, AI-enabled Intelligent Document Processing library for Python. It provides a six-stage pipeline (parse → classify → extract → assess → validate → HITL) to extract structured data from documents. It supports 12+ LLM backends, Pydantic-schema-driven extraction, self-hosted OCR via Nanonets-OCR2-3B, auto-schema discovery, and a human-in-the-loop (HITL) review interface. The library includes a production-ready FastAPI server and a built-in evaluation harness.
Key features
- 12+ LLM backends (including OpenAI, Anthropic, Ollama, and China providers)
- Pydantic-schema-driven extraction with auto-schema discovery - Self-hosted OCR (Nanonets-OCR2-3B) and auto-chunking for oversized documents - Six-stage pipeline with per-field confidence scoring and business rule validation - Human-in-the-loop (HITL) review via Streamlit UI - Built-in eval harness with field F1 and schema-valid rate - Reliability features: retries, cache, checkpoint - CLI and FastAPI server for production deployment
Use cases
- Extracting structured data from invoices, contracts, bank statements, and other documents - Building production document processing pipelines with minimal custom code - Evaluating and improving extraction quality using the built-in eval harness and RL on corrections - Rapid prototyping with zero-config quickstart and mock backend
Getting started
Install the core package: bash pip install py-idp Zero-config quickstart: python from idp.easy import extract_one fields = extract_one('invoice.pdf') print(fields) For a full example, run python examples/00_zero_to_extraction.py with an invoice.pdf in the current directory.
License and pricing
The library is open source under AGPL-3.0 with a commercial option. The license is stated as AGPL-3.0 + commercial in the project summary.
Based on the project's public README and repository metadata.