Welcome to
PyMuPDF

Downloaded more than 30 million times and consistently developed for more than eight years, PyMuPDF is the clear choice for Python developers looking to tap into powerful API functionality for PDF.

Casestudy

Read our latest Casestudy

Available via PyPi

Install easily with: pip install PyMuPDF
DOWNLOADS ON PYPI *
* This visualization shows the 30 million benchmark from PyPi and the average download rate @ around one per 2.8 seconds! Yes, we know this isn't 100% accurate, enjoy responsibly 🙂

Extensive documentation, version controlled with Read the Docs

Get started quickly with the basics or dive into the full API.

Open Source Software (and always will be)

Find us on Github, feel free to contribute!

Discover the PyMuPDF online web console

Please run the samples and/or type your own Python code to learn PyMuPDF.

Note: Expermental work with Pyodide!

Print the version of PyMuPDF

fitz.version
        

Load a document from the web

import pyodide.http
r = await pyodide.http.pyfetch('https://pymupdf.io/docs/mupdf_explored.pdf')
data = await r.bytes()
doc = fitz.Document(stream=data)
print(f'Is PDF: {doc.is_pdf}')
print(f'Number of pages: {doc.page_count}')
        

Count the pages in a document

import pyodide.http
r = await pyodide.http.pyfetch('https://pymupdf.io/docs/mupdf_explored.pdf')
data = await r.bytes()
doc = fitz.Document(stream=data)
for page in doc:
    print(f'Page: {page.number}')
        

Find the annotations in a document

import pyodide.http
r = await pyodide.http.pyfetch('https://pymupdf.io/docs/mupdf_explored.pdf')
data = await r.bytes()
doc = fitz.Document(stream=data)
for page in doc:
    for annot in page.annots():
        print(f'Annotation on page: {page.number} with type: {annot.type} and rect: {annot.rect}')
        

Licensing

PyMuPDF is available under both, open-source AGPL and commercial license agreements.

If you determine you cannot meet the requirements of the AGPL, please contact Artifex for more information regarding a commercial license.