◉ Pulse
maxjendrall avatar
#52 today

maxjendrall/read_pdf_tool

Python AI

Give your agent the images + a markdown extraction of PDFs for high quality answers on PDFs.

Created Jul 22, 2026
Stars
6
Today
+6
Forks
0
Quality
80/100
Momentum
17

README

Fetched from GitHub on Oct 30, 2026, 10:15 PM UTC · README.md

View original on GitHub

Third-party content — Open Source Pulse is not the owner of this repository.

This README belongs to maxjendrall/read_pdf_tool and its contributors. We fetch it directly from the project’s public GitHub repository and display it for reference only. All text, code, images and trademarks remain the property of their respective authors. See the repository for its license terms. Copyright / takedown policy.

read_pdf_tool

Turn a PDF into clean Markdown plus one PNG snapshot per page.

Mistral OCR is the default. Azure Document Intelligence is available as an optional provider.

Quick start

You need uv and a Mistral API key.

1. Install the command

uv tool install read_pdf_tool

This installs the canonical read_pdf_tool command. The legacy read_pdf entry point remains available for compatibility.

2. Save your API key

read_pdf_tool setup --interactive

The prompt looks like this:

$ read_pdf_tool setup --interactive
read_pdf_tool setup

Mistral OCR configuration
Credentials will be stored in /home/you/.read_pdf_tool/.env (mode 600).

Mistral API key (hidden):

Configuration saved.
  File: /home/you/.read_pdf_tool/.env
  Provider: Mistral OCR
  Model: mistral-ocr-latest

The key is hidden while you type and stored locally in a private file.

3. Read a PDF

read_pdf_tool path/to/document.pdf

The command prints the output paths when it finishes. Open pages.md for the extracted text and the page_N.png files to visually check each page.

Run without installing

Use the PyPI package name as the command:

uvx read_pdf_tool path/to/document.pdf

Non-interactive setup

Useful for servers and automation:

export MISTRAL_API_KEY="..."
read_pdf_tool setup --non-interactive

You can also leave the key in the environment and skip setup entirely:

MISTRAL_API_KEY="..." uvx read_pdf_tool document.pdf

Existing configuration is never overwritten silently. Use --force when an intentional replacement is needed.

Output files

A default Mistral run creates a timestamped directory under ~/.read_pdf_tool/conversions/:

~/.read_pdf_tool/conversions/20260722T101624Z_document_ab12cd34/
├── pages.md       # all pages, wrapped with page boundaries
├── document.md    # combined OCR Markdown
├── page_1.md      # OCR text for page 1
├── page_1.png     # rendered snapshot for visual verification
├── response.json  # complete provider response
└── metadata.json  # paths, provider, model, and page counts

The terminal summary contains the exact directory and file paths. Use --json when another program needs to consume that summary.

Common commands

# Write a copy of the merged Markdown to a specific path
read_pdf_tool document.pdf --output /tmp/document.md

# Process only pages 4 and 5
read_pdf_tool document.pdf --start-page 4 --max-pages 2

# Skip local PNG rendering
read_pdf_tool document.pdf --no-images

# Print machine-readable result metadata
read_pdf_tool document.pdf --json

# See every option
read_pdf_tool --help

Agent usage

The intended default workflow is:

  1. Run read_pdf_tool <path>.
  2. Read the pages_md path from the terminal summary.
  3. Inspect every returned page_N.png snapshot unless the user says visual verification is unnecessary.

If read_pdf_tool fails, uvx markitdown <path> can be used as a text-only fallback. Make it clear that the fallback may produce lower-quality output.

Azure Document Intelligence

Mistral is the default. To configure Azure instead:

export AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT="https://example.cognitiveservices.azure.com/"
export AZURE_API_KEY="..."
read_pdf_tool setup --non-interactive --provider azure

For a one-off Azure run:

read_pdf_tool document.pdf --provider azure

Azure defaults to the prebuilt-layout model and can use DefaultAzureCredential when no API key is supplied.

Configuration

The default configuration file is ~/.read_pdf_tool/.env and is created with mode 600.

Variable Purpose Default
READ_PDF_TOOL_PROVIDER mistral or azure mistral
MISTRAL_API_KEY Mistral API credential required for Mistral
MISTRAL_OCR_MODEL Mistral OCR model mistral-ocr-latest
AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT Azure service endpoint required for Azure
AZURE_API_KEY Azure credential optional with DefaultAzureCredential

Environment variables take precedence over values loaded from the config file.

Versions before 0.3 stored configuration in ~/.read_pdf/.env. If the new configuration file does not exist, read_pdf_tool still reads that legacy file as a compatibility fallback. The old READ_PDF_PROVIDER variable is also accepted. New setup runs always write to ~/.read_pdf_tool/.env.

Cost and privacy

PDF contents are sent to the selected OCR provider. Do not process documents that you are not allowed to share with that provider.

Mistral OCR is usage-priced, not generally free. Check the current Mistral API pricing before use.

Troubleshooting

Missing Mistral API key

Run read_pdf_tool setup --interactive, or export MISTRAL_API_KEY.

The wrong provider is selected

Pass --provider mistral or --provider azure, or update READ_PDF_TOOL_PROVIDER in ~/.read_pdf_tool/.env.

Start over with setup

read_pdf_tool setup --interactive --force

Development

From a local checkout:

uv sync
uv run pytest
uv run read_pdf_tool --help
uv build

Test the package through its real entry point before publishing:

uvx --from . read_pdf_tool --help
Rendered by GitHub from the repository’s README. Scroll to read the full file.
First trending

Jul 23, 2026

first spotted on the list

Best rank

#52

highest position reached

Appearances

1

times on the trending list

Quality score

80

out of 100

Momentum

17

trend strength indicator

Star velocity

0.06

stars per day since creation

Activity — last 60 days

daily counts, collected every 6 hours
  • Stars
  • Forks
  • Merged PRs
  • Issues
  • Closed issues

Collecting activity data since launch — check back in a few days.

Star history

total stars per snapshot

Not enough snapshots yet — check back soon.

Rank history

position on trending · lower is better

Not enough snapshots yet — check back soon.

3D card for your website

Live HTML card with a glass surface and pointer tilt. Paste the iframe on any website.

<iframe src="https://www.notionpulse.cc/embed/maxjendrall/read_pdf_tool" width="420" height="240" style="border:0;max-width:100%;background:transparent" loading="lazy" title="maxjendrall/read_pdf_tool — trending on Open Source Pulse"></iframe>

Stars badge

Show current stars in your README or profile. Auto-updates every 6 hours.

maxjendrall/read_pdf_tool stars badge
Markdown
[![maxjendrall/read_pdf_tool](https://www.notionpulse.cc/api/badge/maxjendrall/read_pdf_tool.svg)](https://www.notionpulse.cc/repo/maxjendrall/read_pdf_tool)
HTML
<a href="https://www.notionpulse.cc/repo/maxjendrall/read_pdf_tool"><img src="https://www.notionpulse.cc/api/badge/maxjendrall/read_pdf_tool.svg" alt="maxjendrall/read_pdf_tool stars badge" /></a>

Repository of the Day

#52 Repository of the Day

Repository of the Week

#52 Repository of the Week

Repository of the Month

#52 Repository of the Month