PyMuPDF

Fast Python library for extracting text, tables and images from PDFs and rendering or editing them.

Open SourceSelf HostedOffline Capable
0.0 (0)

About

Built by Artifex on top of its MuPDF C engine, this Python package gives scripts fine-grained control over PDFs and related formats such as XPS, EPUB, MOBI, CBZ, SVG and images. Text comes out as plain strings or as nested blocks carrying font, size, colour and position for every span; find_tables returns tables as Markdown or pandas frames; pages rasterize at any DPI; and scans can be OCRed through a separately installed Tesseract. It writes too: annotations, permanent redactions, form filling, page reordering, merging, encryption, and PDFs generated from Markdown. The companion PyMuPDF4LLM package emits reading-order Markdown or JSON chunks for RAG ingestion, and a paid Pro add-on opens Office and HWP files. Prebuilt wheels exist for Windows, Linux and macOS, covering Python 3.10 through 3.14, nothing else is required, and no network calls happen at runtime, so air-gapped use is fine. The open build is AGPL-3.0, whose copyleft also reaches software offered over a network, so closed-source products generally need Artifex's commercial license. Data engineers get far more speed here than pure-Python parsers offer.

Should you use PyMuPDF?

Pick it when

Pick PyMuPDF when you need fast text, image, and metadata extraction or page rendering across large PDF volumes in Python, and your project is AGPL-compatible or can buy the commercial license.

Look elsewhere when

Skip it in closed-source or hosted products if you will not buy a license, since it is AGPL-3.0; pdfplumber and Docling are MIT. For scanned pages with no text layer, run OCRmyPDF or a layout model first.

Alternatives to PyMuPDF

  • pdfplumber

    MIT-licensed with character-level detail and visual table debugging, but built on pdfminer.six rather than a high-performance native engine.

  • Docling

    Produces structured Markdown with layout and tables for RAG, heavier to run but far more than a raw text dump.

  • Marker

    Adds layout and OCR models for clean Markdown from complex or scanned PDFs, at the cost of heavier VLM inference and weights free only below 5 million dollars in revenue.

Reviews (0)

Leave a Review

No reviews yet. Be the first to review!

Details

Price
Free
Platform
Local/Desktop
Difficulty
Beginner (1/5)
License
AGPL-3.0
Added
Apr 3, 2026

Tags