Virtual environment (recommended)
We recommend using a virtual environment to avoid installing packages globally. Here’s a quick setup:Installation
Once activated, install the package:- parsefy: Parsefy SDK for document extraction (includes Pydantic)
Quick example
Try this simple example with a receipt. Download the sample receiptSetup
Set your API key as an environment variable:Extract your first document
Required vs Optional Fields
Rule of thumb: Mark fields as optional if they might be missing in >20% of your documents.
Confidence Threshold
Control when the fallback model is triggered:Async usage
Next steps
FastAPI
Build APIs with FastAPI
Flask
Create extraction endpoints in Flask
