pymupdf/PyMuPDF

PyMuPDF is a high performance Python library for data extraction, analysis, conversion & manipulation of PDF (and other) documents.

What it solves

PyMuPDF solves the need for fast, accurate processing of PDFs and other document formats in Python. It handles everything from extracting text, tables, and images to rendering pages, converting to PDF, and adding annotations or redactions — all locally without cloud dependencies.

How it works

PyMuPDF is a Python wrapper around MuPDF, a lightweight C engine. This gives it speed and precision. It provides both low-level control (like exact positions, fonts, colors) and high-level APIs (like find_tables() and to_markdown()). For scanned documents, it supports OCR integration with Tesseract or RapidOCR. For office formats (DOCX, XLSX, PPTX etc.), the separate PyMuPDF Office extension adds conversion capabilities.

Who it’s for

Developers building applications that need to read, write, or manipulate PDFs and other documents — especially those powering AI pipelines (RAG, summarization, data extraction) or working in regulated industries that require local processing. Also useful for document automation, reporting, and general PDF tooling.

Highlights

  • Built on the MuPDF C engine for 10–50× faster text extraction and 100× faster rendering than pure-Python libraries
  • LLM-ready outputs: Markdown, JSON, and plain text with layout-aware structure
  • Table detection and export to Markdown or Pandas DataFrames
  • OCR support with Tesseract or RapidOCR (recommended)
  • Annotations, redactions, form filling, bookmarks, links, and metadata editing
  • Runs entirely on your machine — no cloud or telemetry calls
  • Supports reading and writing many formats: PDF, XPS, EPUB, SVG, images, and more
  • Uses ONNX Runtime for layout analysis features (optional)

Related

  • Project
  • Project
  • Project
  • Project
  • Project