Skip to content
READ PDFs WITH

pydelity

pydelity turns PDFs into structured JSON. Its first step, the survey, reads a PDF with an Anthropic or OpenAI model and records how its pages are laid out: page numbers, rotation, writing direction and repeated lines, with a list of things for a person to review.

This release does the survey only. Later releases add the steps that extract each page’s content and assemble it into one document.

  1. Install pydelity with uv, which also installs Python 3.13 if you don’t have it:

    Terminal window
    uv tool install --python 3.13 pydelity
  2. Set your Anthropic API key, replacing [API_KEY] with your own key:

    Terminal window
    export ANTHROPIC_API_KEY="[API_KEY]"

    In Windows PowerShell, run $env:ANTHROPIC_API_KEY = "[API_KEY]" instead.

  3. In the folder that holds your PDF, run a survey:

    Terminal window
    pydelity document.pdf

    pydelity measures the PDF, shows what the survey will likely cost and asks before sending anything. Type y and press Enter to go ahead.

  4. Open pydelity-output/document/report.html in a browser to see the results and the issues to review.

See Install pydelity for other ways to install and the platforms PyMuPDF doesn’t support, and Your first survey for a walkthrough.