What do you want to do?
4 use cases
-
Extract invoice fields into a validated schema
Turn invoice PDFs into Pydantic-validated fields using one pipeline call or one CLI command.
- Py Idp
- Work and operations
- Intermediate
View prompt
Using the py-idp repo, run the idp CLI on <path to invoice PDF> with --schema Invoice and --backend openai, then print the extracted fields. Verify that the output is a dict whose keys match the Invoice schema fields and that no validation errors are reported.
-
Route low-confidence fields to a human reviewer
Send fields below the confidence threshold to a Streamlit review screen and save the corrections.
- Py Idp
- Work and operations
- Advanced
View prompt
In the py-idp repo, run one document through the pipeline and find which fields fall below the confidence threshold. Use the Streamlit HITL review screen to correct them, then confirm the corrections are saved in storage. Report the list of corrected fields.
-
Measure extraction accuracy with the eval harness
Score a backend on field F1 and schema-valid rate before you trust it in production.
- Py Idp
- Work and operations
- Intermediate
View prompt
In the py-idp repo, run `idp eval` on the labeled set at <path to eval data> using the <backend name> backend. Output the field F1 and schema-valid rate per field. Verify that the report lists every schema field.
-
Serve document extraction through a FastAPI endpoint
Run the production FastAPI server so other systems can send documents and get fields back.
- Py Idp
- Work and operations
- Advanced
View prompt
In the py-idp repo, start the FastAPI server with `idp serve`, then send <path to document> to the /extract endpoint. Return the JSON response. Verify that /healthz returns a healthy status before you send the document.
How to use Py Idp
- Check you have what it needs: Python with pip available; An API key for a hosted LLM backend such as OpenAI, or a local backend such as Ollama (the zero-config path runs on the in-tree mock backend without a key); A sample PDF or text file to test with, such as invoice.pdf.
- Open rollroyces/py-idp on GitHub and read the README and license.
- Run
pip install py-idpto install the core package. No API key is needed for this step. - Place invoice.pdf in the current directory and run
python examples/00_zero_to_extraction.pyto see extracted fields from the mock backend. - Run
export OPENAI_API_KEY=...with your own key. - Run
idp run invoice.pdf --schema Invoice --backend openaito extract the fields with a hosted model.
These steps come from our top use case, Extract invoice fields into a validated schema, which also has a copy-paste agent prompt.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forPython developers and back-office teams who turn invoices, contracts, and other PDFs into validated structured data.
- Why it is hot
- LanguagePython
- Sourcegithub.com/rollroyces/py-idp · Back to Hot repos
Requirements
- Python with pip available
- An API key for a hosted LLM backend such as OpenAI, or a local backend such as Ollama (the zero-config path runs on the in-tree mock backend without a key)
- A sample PDF or text file to test with, such as invoice.pdf
Maintain Py Idp? Add the Featured on Deduped badge
Paste this into your README:
[](https://dedupedai.com/use-cases/rollroyces-py-idp/?ref=badge)
Questions about Py Idp
What is Py Idp?
py-idp is an open-source Python library for intelligent document processing that uses LLM backends and Pydantic schemas to pull structured fields out of documents. It is an open-source project on GitHub: https://github.com/rollroyces/py-idp.
Who is Py Idp for?
Python developers and back-office teams who turn invoices, contracts, and other PDFs into validated structured data.
What can I do with Py Idp?
4 use cases so far, for example: Extract invoice fields into a validated schema; Route low-confidence fields to a human reviewer; Measure extraction accuracy with the eval harness. Each has steps and a copy-paste agent prompt.
What do I need to run Py Idp?
Python with pip available; An API key for a hosted LLM backend such as OpenAI, or a local backend such as Ollama (the zero-config path runs on the in-tree mock backend without a key); A sample PDF or text file to test with, such as invoice.pdf.
What are alternatives to Py Idp?
Other hot AI repos in Work and operations: AI Job Search, Solidcraft, Fastbrowse, Awesome AI Agent Platforms, Nautilo.
Is Py Idp safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.