Skip to main content

Python bindings for the PDF toolkit and renderer MuPDF

Project description

PyMuPDF 1.20.0

logo

Release date: June 16, 2022

On PyPI since August 2016: Downloads

Author

Artifex, based on code by Jorj X. McKie and Ruikai Liu.

Introduction

PyMuPDF adds Python bindings and abstractions to MuPDF, a lightweight PDF, XPS, and eBook viewer, renderer, and toolkit. Both PyMuPDF and MuPDF are maintained and developed by Artifex Software, Inc.

MuPDF can access files in PDF, XPS, OpenXPS, CBZ, EPUB and FB2 (eBooks) formats, and it is known for its top performance and exceptional rendering quality.

With PyMuPDF you can access files with extensions like .pdf, .xps, .oxps, .cbz, .fb2 or .epub. In addition, about 10 popular image formats can also be handled like documents: .png, .jpg, .bmp, .tiff, etc.

Usage

For all supported document types (i.e. including images) you can

  • Decrypt the document.
  • Access meta information, links and bookmarks.
  • Render pages in raster formats (PNG and some others), or the vector format SVG.
  • Search for text.
  • Extract text and images.
  • Convert to other formats: PDF, (X)HTML, XML, JSON, text.
  • Do OCR (Optical Character Recognition) if Tesseract is installed.

To some degree, PyMuPDF can also be used as an image converter: it can read a range of input formats and can produce Portable Network Graphics (PNG), Portable Anymaps (PNM, etc.), Portable Arbitrary Maps (PAM), Adobe PostScript and Adobe Photoshop documents, making the use of other graphics packages obselete in these cases. But interfacing with e.g. PIL/Pillow for image input and output is easy as well.

For PDF documents, there exists a plethora of additional features: they can be created, joined or split up. Pages can be inserted, deleted, re-arranged or modified in many ways (including annotations and form fields).

  • Images and fonts can be extracted or inserted.

    You may want to have a look at this cool GUI example script, which lets you insert, delete, replace or re-position images under your visual control.

    If fontTools is installed, subsets can be built for eligible fonts based on their usage in the document. Especially for new PDFs, this can lead to significant file size reductions.

  • Embedded files are fully supported.

  • PDFs can be reformatted to support double-sided printing, posterizing, applying logos or watermarks

  • Password protection is fully supported: decryption, encryption, encryption method selection, permission level and user / owner password setting.

  • Support of the PDF Optional Content concept for images, text and drawings.

  • Low-level PDF structures can be accessed and modified.

  • Command line module "python -m fitz ...". A versatile utility with the following features

    • encryption / decryption / optimization
    • creation of sub-documents
    • document joining
    • image / font extraction
    • full support of embedded files
    • layout-preserving text extraction (all documents)

Have a look at the basic demos, the examples (which contain complete, working programs), and notebooks.

Documentation

Documentation is written using Sphinx and is available in various formats from the following sources. It currently is a combination of reference guide and user manual. For a quick start look at the tutorial and the recipes chapters.

The latest changelog can be viewed here.

Installation

PyMuPDF requires Python 3.7 or later.

For versions 3.7 and up, Python wheels exist for Windows (32bit and 64bit), Linux (64bit, Intel and ARM) and Mac OSX (64bit, Intel only), so it can be installed from PyPI in the usual way. To ensure pip support for the latest wheel platform tags, we strongly recommend to always upgrade pip first.

python -m pip install --upgrade pip
python -m pip install --upgrade pymupdf

There are no mandatory external dependencies. However, some optional features become available only if additional packages are installed:

  • Pillow for using pillow image output directly from PyMuPDF
  • fontTools for creating font subsets.
  • pymupdf-fonts contains some nice fonts for your text output.
  • Tesseract-OCR for optical character recognition in images and document pages. Tesseract is separate software, not a Python package. To enable OCR functions in PyMuPDF, the system environment variable "TESSDATA_PREFIX" must be defined and contain the tessdata folder name of the Tesseract installation location.

Older wheels - also with support for older Python versions - can be found here and on PyPI.

Note: If pip cannot find a wheel that is compatible with your platform, it will automatically build and install from source using the PyMuPDF sdist; this requires only that SWIG is installed on your system.

[New in PyMuPDF-1.20: there is no need to separately build or install MuPDF; the required MuPDF source code is already in the sdist and is automatically built into PyMuPDF.]

License and Copyright

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

Please read the full text of the AGPL license agreement (which is also included here in file COPYING) to ensure that your use case complies with the guidelines of this license. If you determine you cannot meet the requirements of the AGPL, please contact Artifex for more information regarding a commercial license.

Artifex is the exclusive commercial licensing agent for MuPDF.

Artifex, the Artifex logo, MuPDF, and the MuPDF logo are registered trademarks of Artifex Software Inc. PyMuPDF and the PyMuPDF logo are trademarks of Artifex Software, Inc. © 2022 Artifex Software, Inc. All rights reserved.

Contact

Please use the Discussions menu for questions, comments, or asking for help, and submit issues here.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyMuPDF-1.20.0.tar.gz (90.4 MB view details)

Uploaded Source

Built Distributions

PyMuPDF-1.20.0-cp310-cp310-win_amd64.whl (6.6 MB view details)

Uploaded CPython 3.10 Windows x86-64

PyMuPDF-1.20.0-cp310-cp310-win32.whl (5.9 MB view details)

Uploaded CPython 3.10 Windows x86

PyMuPDF-1.20.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

PyMuPDF-1.20.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

PyMuPDF-1.20.0-cp310-cp310-macosx_10_9_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

PyMuPDF-1.20.0-cp39-cp39-win_amd64.whl (6.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

PyMuPDF-1.20.0-cp39-cp39-win32.whl (5.9 MB view details)

Uploaded CPython 3.9 Windows x86

PyMuPDF-1.20.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

PyMuPDF-1.20.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.8 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

PyMuPDF-1.20.0-cp39-cp39-macosx_10_9_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

PyMuPDF-1.20.0-cp38-cp38-win_amd64.whl (6.6 MB view details)

Uploaded CPython 3.8 Windows x86-64

PyMuPDF-1.20.0-cp38-cp38-win32.whl (5.9 MB view details)

Uploaded CPython 3.8 Windows x86

PyMuPDF-1.20.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

PyMuPDF-1.20.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

PyMuPDF-1.20.0-cp38-cp38-macosx_10_9_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

PyMuPDF-1.20.0-cp37-cp37m-win_amd64.whl (6.6 MB view details)

Uploaded CPython 3.7m Windows x86-64

PyMuPDF-1.20.0-cp37-cp37m-win32.whl (5.9 MB view details)

Uploaded CPython 3.7m Windows x86

PyMuPDF-1.20.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

PyMuPDF-1.20.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.7 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

PyMuPDF-1.20.0-cp37-cp37m-macosx_10_9_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file PyMuPDF-1.20.0.tar.gz.

File metadata

  • Download URL: PyMuPDF-1.20.0.tar.gz
  • Upload date:
  • Size: 90.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for PyMuPDF-1.20.0.tar.gz
Algorithm Hash digest
SHA256 443675ed28dc9be5c9521e17ff9a20299a78b8b94f4c457d7b7aa81899c00ee7
MD5 d390c9c1700c6a47b66b667186cdf5d1
BLAKE2b-256 192d73cb79152442ace5a6f55de17755e7c4c0dbed5ac6180baa1767d6a0e279

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e4a34b1985cc2e4a6528e710b8cb0b46d394d88c223b7a880949d318bc2bea86
MD5 297bc7ce6fd5b24e77b7cbfe1dcca8b7
BLAKE2b-256 3bbfca2123b44e79fa16d6db520f263c2516171829f1b4fb536791a2229f5ff1

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: PyMuPDF-1.20.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for PyMuPDF-1.20.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 56fec33bcf3f9bf0b9a70c2a7ca2c46b87f97144ee016e20f749c0b58b95dabb
MD5 79905e7248c39178654ec0a38a3e500c
BLAKE2b-256 3904ccd5b98fc498816a1e7497650344f5d5126b33b64a8f434544eff7bc6a33

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 60f61f1b5e68759cfa7cc0c4df008ee5d95d0d2e1337ee62c33c869ca128e82f
MD5 fa09006c309f3c04cadb3a8a07adf9b5
BLAKE2b-256 a110a6ba16bcf7a8fa87868ba6952659a1c878102eac22037ef5052a5f790b78

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 57595fd79594ccc6968ce07de9f69f615cc3f516b356706710f255f9beb8783e
MD5 f0821c76f44c5c5490f1f388bbdb5695
BLAKE2b-256 3eecc0886db4087121cd4d8fdd6291c037409e12690a9a74e5eff8be5bb1cdd1

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3ad34aa62e05551bce30cbda0f7abbc45bf0b40599e581e7bc21c32d06d92d38
MD5 b47b2aec114039b07bdd87fe3da84dab
BLAKE2b-256 619158a86da0a96b3ed8be482713e0f0b973cef0fb6b8d0b236f87aaf24bd934

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: PyMuPDF-1.20.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 6.6 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for PyMuPDF-1.20.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 7bc2e9ee90db199edd034ea6d9398e05c140c692bd0dcb0bfdb53e0b53239caf
MD5 d8b0594c0bb54eb849ec29daeab33dde
BLAKE2b-256 30bc264c3b1cc14e43999c540620d20af87ae196b7dd11fa47b548ef75c7d27a

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp39-cp39-win32.whl.

File metadata

  • Download URL: PyMuPDF-1.20.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for PyMuPDF-1.20.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 fe7b85a4204f154c817a02c6ff89024c798e50055709605ecf1938d020e26c4c
MD5 fcce7b15dde4fd4a34a3ddfdcc0dc6d5
BLAKE2b-256 51e8a30a11f536cb2989499f1bfb206750b5b92db0cd808a445344f4517c7f71

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5400ef843cf195e3e0c24fc938dcc466759f731876378b5bdf1242824c262bc
MD5 7eb2b506e52a659270cf2229a737f7d3
BLAKE2b-256 7b70960afb99d22abaeed51ea8e53d68c5b0a152e09d09f0b0d71d0138df8729

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e2d1c3abc48a4d11780265faf4290d2291d0955a25d6867b8c3152e0ddfd5389
MD5 67808beadd416bbbdcae7a63ec248d3d
BLAKE2b-256 5d4dfb2561b5f79554245f9b419e07dde9b522ac3d86d98f9f3ed9023f193dd1

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ee038b04bac3fa08b3eb91b7f9f58ef6b5bdfa73de2ef22194e4bf2156e6291f
MD5 74a338ce21f26b00550d3a05d0592b89
BLAKE2b-256 042a983187269a5cc8acd624a02fa41ccb6df7c3312fdcc2aac54e4ae68ebd49

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: PyMuPDF-1.20.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 6.6 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for PyMuPDF-1.20.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 50243c064af78482dedb02fb102a2e921fe661665dec9966e55b966d5a51b737
MD5 13e6a000a104bc4b873505aa1ebba668
BLAKE2b-256 88fea899f788e1717dcdc99bfb877d7e93c4f8c6aea217ca51a50e48a531fd55

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp38-cp38-win32.whl.

File metadata

  • Download URL: PyMuPDF-1.20.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for PyMuPDF-1.20.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 530efb8a11ca9c0f165d9fe837da7062aba4731f3280209580846293f2b65514
MD5 a12a5e4e7c4ad22583f642723036ab28
BLAKE2b-256 f0790c8295d9dc0118a8c71f46fef547931c18c323495298e0f38435cef370e8

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3f6d5aef2228c9c3b400e526ebaee2d6f18f8849808b4568053bed3d272594b2
MD5 e77866c7d5b6b9ede93e1efeef657833
BLAKE2b-256 2c8fe1315c7f5fd6606e676acdc868a9f1b5cb8547c79febbc2c6b7071e0d12d

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 25c7fa00df518f27fad66affdc488303635a691c33e95149e100e596537138ef
MD5 b8827bd439aa2276add4cac7b8bb8089
BLAKE2b-256 28b1f7758eec5200697bc3d01460f5fe4378bda82cad522a6c4a58ad3c363c09

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 451ecb5d13a276c5594f1bcdda602a8c9d7c63ba655778c637b06d919182d3ed
MD5 a5c2c6ad8cb6b6f2845054db543a4f42
BLAKE2b-256 1ebcb1d5db711d97d757b5ab5ceada4d638a3d8acf26378cc7281d1d4e5f6375

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: PyMuPDF-1.20.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 6.6 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for PyMuPDF-1.20.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 ca472401b939cac660c9d7e3e5691449b2fdc9de2244b4d7f84f3935cfae7b01
MD5 912b2cc32ba542325215a6558b46909f
BLAKE2b-256 2e1a98557f30b4fa8ce30c9d13a4a01f140c2521aba0bc9b5456301a66fe773a

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp37-cp37m-win32.whl.

File metadata

  • Download URL: PyMuPDF-1.20.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for PyMuPDF-1.20.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 4abf2ecb07689b14c7fbbece50f112bbc767b2060c4ec08a51054f2513217d31
MD5 531ed968c6ea5227ca24dc496b7dd8cf
BLAKE2b-256 bf4a55b4400bad0bb375d84077dc25691d3804d17d6ee98baca77ae747cef4a9

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 37c4a2b57662900a42285ad001f93fd68416ecbbaab9909c871f07865fafa502
MD5 2bb608be4378f7ee3444f35fde590f6c
BLAKE2b-256 f153e7bdceb1cf6dad340c19afdb04ef48e0df8b9710630d7eff1a65b0663df1

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3e00046da47d8c06db2d411447cb520f28f12195c0617a27666bb317b153a108
MD5 657bb18f2bc2b2ddcabd288a43295adb
BLAKE2b-256 0e2ba9f6f8b2520153c532f3cf8c9eabd1d4475dc8a02913a772cdc65ec9cf07

See more details on using hashes here.

File details

Details for the file PyMuPDF-1.20.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for PyMuPDF-1.20.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c0a5c382593f32e8d3c39cf0a70b44f6c7a58d237becc552181b00441ddc1ce5
MD5 ea169d392f85c323897e465f27543ab3
BLAKE2b-256 c003e5fdbbd7f22b2d73e222cb69443c2131b9db8520653c5eb6d1e25a7bdd9e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page