pydelity
pydelity reads a PDF with an Anthropic or OpenAI model and records how its pages are laid out: page numbers, rotation, writing direction, languages and the lines that repeat on many pages, such as headers and footers. It saves the results as JSON, with a list of things a person should check, and an HTML report you can open in a browser.
This survey is the first step of a longer pipeline that will turn a PDF into faithful, structured JSON. Version 0.1.0 does the survey only. Later releases add the other steps.
- Docs: https://idinsight.github.io/pydelity/
- Source code: https://github.com/IDinsight/pydelity
Install
pydelity needs Python 3.13 or 3.14 on Windows, macOS or Linux. On a Mac, Python 3.14 needs macOS 14 or later. Python 3.15 isn't supported yet, because a library PyMuPDF needs has no Python 3.15 release.
To use the pydelity command anywhere, install it with
uv, which downloads
Python 3.13 if you don't have it:
uv tool install --python 3.13 pydelity
To use it from Python, install it into your project's environment instead, for
example with pip install pydelity or uv add pydelity, in an environment that
runs Python 3.13 or 3.14.
pydelity is MIT-licensed. It uses PyMuPDF to read PDFs, which is licensed under the AGPL-3.0 or a commercial license from Artifex. Check that this fits how you plan to use and share your own code.
Set an API key
pydelity reads the API key from an environment variable: ANTHROPIC_API_KEY for
Anthropic models (the default) or OPENAI_API_KEY for OpenAI models. It does
not read .env files.
# macOS and Linux
export ANTHROPIC_API_KEY="[API_KEY]"
# Windows PowerShell
$env:ANTHROPIC_API_KEY = "[API_KEY]"
Replace [API_KEY] with your own key. These commands set the key for the
current terminal only.
Install pydelity shows
how to keep it set.
Run a survey
pydelity document.pdf
pydelity measures the PDF, shows what the survey will likely cost and asks
before it sends anything to the model. The results go to
pydelity-output/document/ in the current folder. Open report.html there to
see them. Run pydelity --help for the options.
From Python:
import pydelity
# Python doesn't ask before spending. pydelity.estimate("document.pdf")
# shows the likely cost first, with no API key needed.
result = pydelity.run("document.pdf", languages=["en"])
# Each issue is something a person should check.
for issue in result.record.review:
print(issue.page_index, issue.message)
In Jupyter and other async code, use await pydelity.arun(...) instead.
Settings
You can keep settings in a JSON or YAML file and pass it with
pydelity --config config.yaml. The
examples/ folder
has a file in each format with every setting at its default value. Copy one and
change what you need.
Learn more
- Your first survey walks through a run and its output files.
- The guides cover settings, the command line, Python, models, costs, reruns and outputs.
- The reference lists every setting, option, function and output field.
- Contributing covers local development, the docs site and releases.
Metadata
Release files for pydelity 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydelity-0.1.1.tar.gz | 97.3 kB | With provenance | Details for pydelity-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydelity-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pydelity-0.1.1-py3-none-any.whl |
Total release size: 210.0 kB
Release files / pydelity-0.1.1.tar.gz
| Download URL | pydelity-0.1.1.tar.gz |
|---|---|
| Size | 97.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
832eacc0f5f48101a04e73ce2a6e95339e36d367ee2da308211a78e364c87cac
|
|
BLAKE2b-256 checksum How to use checksums |
82d6a42da1442db8888cebbbe2e3ebe19f80fbbba2748a008015af961bf24c34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logRelease files / pydelity-0.1.1-py3-none-any.whl
| Download URL | pydelity-0.1.1-py3-none-any.whl |
|---|---|
| Size | 112.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1732c33913fe07f29f2b9b32bc4d46c47daca1207e49790f32e8284049ebdbe
|
|
BLAKE2b-256 checksum How to use checksums |
69026ed6bd4670572c249ec5d7620e777df50def4c50fb018b57ac5cb0637e12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logSecurity for pydelity 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pydelity-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.