From 088266f6ef3222b6631a5fe435825492b3484eff Mon Sep 17 00:00:00 2001 From: Jamie Lemon Date: Wed, 18 Nov 2026 00:08:25 +0000 Subject: [PATCH] Docs: Updates core messaging, tidies up llms.txt --- README.md | 6 ++---- docs/index.rst | 2 +- docs/llms/llms-full.txt | 36 +++++++++++++++++++++++++++++------- docs/llms/llms.txt | 4 ++-- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 917e6b343..c0eafc5a8 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ **The PDF engine behind over 50 million monthly downloads, powering AI pipelines worldwide.** -**PyMuPDF is a high-performance Python library for data extraction, layout analysis, conversion, rendering and manipulation of PDF (and other) documents.** Built on top of MuPDF — a lightweight, fast C engine — PyMuPDF gives you precise, low-level control over documents alongside high-level convenience APIs. +**PyMuPDF is a layout-aware document engine for AI and a feature-rich Python toolkit for extracting, rendering and editing PDFs and other documents**. Since version 2.0, its ML-based layout analysis turns PDFs and Office files into high-quality Markdown for RAG and agents, running fast on CPU and grounding every result to its source page. [![Star on GitHub](https://img.shields.io/github/stars/pymupdf/PyMuPDF.svg?style=for-the-badge&label=Star&logo=github)](https://github.com/pymupdf/PyMuPDF/) @@ -36,7 +36,7 @@ - **Accurate** — pixel-perfect text extraction with font, color, and position metadata - **Versatile** — read, write, annotate, redact, merge, split, and convert documents - **LLM-ready** — structured data with JSON & native Markdown output for RAG and AI pipelines -- **Grounded results** — improved, verifiable results, see: [PyMuPDF & Grounding](https://pymupdf.readthedocs.io/en/latest/grounding.html?utm_source=github&utm_medium=referral&utm_campaign=pymupdf_github&utm_content=documentation_community&utm_term=pymupdf_grounding) +- **Grounded results** — improved, verifiable results, see: [PyMuPDF & Grounding](https://pymupdf.io/grounding/?utm_source=github&utm_medium=referral&utm_campaign=pymupdf_github&utm_content=documentation_community&utm_term=pymupdf_grounding) --- @@ -54,8 +54,6 @@ pip install --force-reinstall --no-cache-dir pymupdf This will ensure a clean installation of PyMuPDF. - - ### Wheels Wheels are available for **Windows**, **macOS**, and **Linux** on Python 3.11–3.15. If no pre-built wheel exists for your platform, pip will compile from source (requires a C/C++ toolchain). diff --git a/docs/index.rst b/docs/index.rst index 1b6720709..09360b283 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -19,7 +19,7 @@ Welcome to |PyMuPDF| ================================ -|PyMuPDF| is a high-performance **Python** library for data extraction, analysis, conversion & manipulation of |PDF| (and other) documents. +|PyMuPDF| is a layout-aware document engine for AI and a feature-rich **Python** toolkit for extracting, rendering and editing PDFs and other documents. Since version 2.0, its ML-based layout analysis turns PDFs and Office files into high-quality |Markdown| for RAG and agents, running fast on CPU and grounding every result to its source page. |PyMuPDF| is hosted on `GitHub `_ and registered on `PyPI `_. diff --git a/docs/llms/llms-full.txt b/docs/llms/llms-full.txt index c077fde03..e463a43b8 100644 --- a/docs/llms/llms-full.txt +++ b/docs/llms/llms-full.txt @@ -1,8 +1,8 @@ # PyMuPDF -> PyMuPDF is a high-performance Python library for data extraction, analysis, conversion and manipulation of PDF (and other) documents. It includes PyMuPDF4LLM, a companion package specifically designed for LLM and RAG pipelines. +> PyMuPDF is a layout-aware document engine for AI and a feature-rich Python toolkit for extracting, rendering and editing PDFs and other documents. Since version 2.0, its ML-based layout analysis turns PDFs and Office files into high-quality Markdown for RAG and agents, running fast on CPU and grounding every result to its source page. -PyMuPDF is hosted on [GitHub](https://github.com/pymupdf/PyMuPDF) and registered on [PyPI](https://pypi.org/project/PyMuPDF/). It wraps MuPDF, a lightweight PDF/XPS/eBook viewer and toolkit. +PyMuPDF is hosted on [GitHub](https://github.com/pymupdf/PyMuPDF) and registered on [PyPI](https://pypi.org/project/PyMuPDF/). It is built on top of [MuPDF](https://mupdf.com). --- @@ -10,14 +10,12 @@ PyMuPDF is hosted on [GitHub](https://github.com/pymupdf/PyMuPDF) and registered ``` pip install pymupdf -pip install pymupdf4llm ``` Import as: ```python import pymupdf -import pymupdf4llm ``` --- @@ -95,7 +93,14 @@ pix.save("page-0.png") ## PyMuPDF4LLM -PyMuPDF4LLM is a lightweight extension for PyMuPDF that converts documents into structured Markdown, JSON, and plain text optimised for RAG pipelines, vector embeddings, and LLM ingestion. It handles multi-column layouts, tables, images, headers, and scanned pages with automatic OCR — all powered by the MuPDF C engine. +PyMuPDF4LLM converts documents into structured Markdown, JSON, and plain text optimised for RAG pipelines, vector embeddings, and LLM ingestion. It handles multi-column layouts, tables, images, headers, and scanned pages with automatic OCR — all powered by the MuPDF C engine. + +**Since PyMuPDF 2.0, PyMuPDF4LLM and PyMuPDF Layout are included in the main `pymupdf` package by default.** `pip install pymupdf` is all you need; there is no separate package to install. You can use the features in two ways: + +- As `Document` methods: `doc.to_markdown()`, `doc.to_json()` and `doc.to_text()` +- Through the `pymupdf4llm` module: `pymupdf4llm.to_markdown(...)`, as in the examples below + +Layout analysis is on by default. Call `pymupdf.use_layout(False)` to turn it off. ### Key Features @@ -110,13 +115,30 @@ PyMuPDF4LLM is a lightweight extension for PyMuPDF that converts documents into ### Installation ``` -pip install pymupdf4llm +pip install --upgrade pymupdf +``` + +This installs PyMuPDF together with PyMuPDF4LLM and PyMuPDF Layout. Do not install `pymupdf4llm` or `pymupdf-layout` separately on PyMuPDF 2.0 or later. If an earlier separate install broke your environment, repair it with: + +``` +pip install --force-reinstall --no-cache-dir pymupdf ``` -Tesseract must be installed separately if OCR is needed. +OCR needs at least one OCR engine, such as RapidOCR or Tesseract, installed separately. ### Basic Usage +```python +import pymupdf + +doc = pymupdf.open("input.pdf") +md_text = doc.to_markdown() # Markdown +json_text = doc.to_json() # JSON string +plain_text = doc.to_text() # plain text +``` + +The same conversion through the `pymupdf4llm` module: + ```python import pymupdf4llm diff --git a/docs/llms/llms.txt b/docs/llms/llms.txt index b4ddaf575..556314608 100644 --- a/docs/llms/llms.txt +++ b/docs/llms/llms.txt @@ -1,8 +1,8 @@ # PyMuPDF -> PyMuPDF is a high-performance Python library for data extraction, analysis, conversion and manipulation of PDF (and other) documents. It includes PyMuPDF4LLM, a companion package specifically designed for LLM and RAG pipelines that converts documents into structured Markdown, JSON, and plain text. +> PyMuPDF is a layout-aware document engine for AI and a feature-rich Python toolkit for extracting, rendering and editing PDFs and other documents. Since version 2.0, its ML-based layout analysis turns PDFs and Office files into high-quality Markdown for RAG and agents, running fast on CPU and grounding every result to its source page. -PyMuPDF is hosted on [GitHub](https://github.com/pymupdf/PyMuPDF) and registered on [PyPI](https://pypi.org/project/PyMuPDF/). It is built on top of MuPDF, a lightweight PDF and XPS viewer. +PyMuPDF is hosted on [GitHub](https://github.com/pymupdf/PyMuPDF) and registered on [PyPI](https://pypi.org/project/PyMuPDF/). It is built on top of [MuPDF](https://mupdf.com). ## Docs