Skip to main content

Python bindings for the PDF toolkit and renderer MuPDF

Project description

PyMuPDF 1.20.1

logo

Release date: June 27, 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.1.tar.gz (90.4 MB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 Windows x86

PyMuPDF-1.20.1-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.1-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.1-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.1-cp39-cp39-win_amd64.whl (6.6 MB view details)

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 Windows x86

PyMuPDF-1.20.1-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.1-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.1-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.1-cp38-cp38-win_amd64.whl (6.6 MB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 Windows x86

PyMuPDF-1.20.1-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.1-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.1-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.1-cp37-cp37m-win_amd64.whl (6.6 MB view details)

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m Windows x86

PyMuPDF-1.20.1-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.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: PyMuPDF-1.20.1.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.1.tar.gz
Algorithm Hash digest
SHA256 305c1a64b8fb2fd465e27cc8bdcbf0f64224f0ec6d7763e3f5f2ca6783136649
MD5 db2ae3c8472767858dd91f4b613622f4
BLAKE2b-256 29e4d1d88146ef0b3b97d785acc7aed22b9774ac6bcf137e98b48a9c9bbb7f35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c390228b3bb5d63b0765d1a3e37ecdbe80771e81b06ef8badf51a69954f3a67a
MD5 7175c1fd0b0eb6451b21e7da4e111a7a
BLAKE2b-256 3dfee1979617cdbd7e22995314d687345712e43bd8c43099f0926d17687e5ba0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.1-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.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 5dd4f3ec6b65c5b5cfc559d1d99c09983924714170ff262cf2d7eba080545bfe
MD5 6223c6381cf65fb574b757fbb005de5b
BLAKE2b-256 9c0b4507703efcdd996044d89880a3cde18c3d5ec4a84922dc6997d3b1402a00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 12167cd3a58f50b9e67600112834d588beeec400ffce06564b8f2bf2b8b8f9f7
MD5 deabf4f333e31540185cbba9b2d559d3
BLAKE2b-256 b6a3bca132d4af5385187c7f78b1a926342a8d647dc78da7ba78ad7a90c9c495

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 524396cb72a361b1382ad6dbb7ad51b123b76cd98e88fafe46f96252ebb8a484
MD5 1dbdf9503f964710a494601758c05536
BLAKE2b-256 25409c85e9f4c3ba6646605f4d0eb43cb37cac27954f511f9b2a98129283edbb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8d37aeebe2b22f9d1706e3cbcb889dab644988fb05bdb5275c701634961044e6
MD5 3acba32fcb074edc7dccc9d44c2e3368
BLAKE2b-256 37d7b35342ee77750342119706959a0230f341c90affdd262ef6bf132f6f5e1f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.1-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.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9a44b02244b49a9f3f10116b8b75355c6c9514e3616578b114a7f83e5543d222
MD5 abe27584821414f7b7a6147b996301f2
BLAKE2b-256 1b3617becb3289dc96a99c6186b8e7ce7379d4450c76a74160a2a03da03273d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.1-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.1-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 093caedaac344febd22eff270116d00f85ef3be7cb2ba09dcd67986165098b66
MD5 034908db20d2db65e7a9fea2f7092234
BLAKE2b-256 43799ad9ee04b647d5e7f33e98c90a576102bff92dec7f1a7eede28775b27b84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 743f1ee5ebdba51505d2c81e903dcc9f3903cb07ee99b4419daae1a355b75642
MD5 ccf8fc21729d504813a2fad779eb70c7
BLAKE2b-256 d1ab3ad3c732ffa3ba07d6726021d4d9099c231ca2c108dc57e82fcdddc64cda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7e95b7c867e4a6a8f2fd85c82cb0dc8fbb536eb1a6e9a9e33c8b3d68642c2782
MD5 594b0da960ef2f694d527c9cbe74f7fe
BLAKE2b-256 b3cfdcfe97d72ba72244cbc1f5ee697535cd17f56ff2d04aa64d9ca1f9c87d4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8123e6ba98f9ffe525b007a205694e193d0b69c3bd7d1fcc63894d2c80f74ff5
MD5 6815fb268ccd28ead6bc7b21512cd15c
BLAKE2b-256 5d2c2170145ada56ace2a121e9dfa6328e6c41f48bf7dc235b14f66e03a1b0cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.1-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.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 451e2acef3a06fa57872c1024b11f4cc18a5dfee850e690afebd42d6b288eda6
MD5 7eaed4b6e05603f8b936be3295852c8e
BLAKE2b-256 0413dd7c16640b4336b6bc3b3578f50e80149f238f2ce26f3d46a371acbc10ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.1-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.1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 bee2cad5603cefd753f638da17d11509e0723b290f9ed0847ab8485146722404
MD5 1dab8298d3947b1b902508a3f086a074
BLAKE2b-256 fe4e9efe089cf7b593f6fa2302aa100f5b56c10f163719fd68f1a02c2c6cfd90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cab9da6ed5dbfe0c9ee0084330f8683b15d160c00e681e14f60a23a313f34376
MD5 e832a6bddc06d8f76a93d991b50419d5
BLAKE2b-256 8ea535f653f07e56ba353839db1a73b697fbbf2da0ae728990031fb910b0c02c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 06f5970f7851a97fbd0b7ea424ba44c150a7f6570a38fb582348098e51627c68
MD5 39fca146e3ebee32f494bdfa18efcba6
BLAKE2b-256 8df49a3f050b92934df88186db331ed36336270fb3ded5d4f0f2e9f7879c80c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9d1c6da88f9534034b306acc4246215819f2bc1cd4757c08bee26b4a6e8d1104
MD5 4a817743b145b2cf7599f0ca3ef6a073
BLAKE2b-256 1caf1a06820dede9a618809bd8dfeed0e0705f13cad1a20d7b441b06305914b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.1-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.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 0cab37b154c53ba45aa38b13d93410e7260fe067138a9ff7acdfcc4cc6e5ae89
MD5 17059c172b711cba1be3f16bd7a17a39
BLAKE2b-256 13960ce6a6aa267706346abca4ca13820b0ef6370764c47b1fc7abd6aae0165e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.1-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.1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 37979b53d27bc6618faf246635849bdd96a0452ac324d18830749d7bfa9f05f6
MD5 060280efca3eb218f6616f06406d1a9d
BLAKE2b-256 4d7f70666a733616765cf85ff39dcd94e4b1d85c2426e3535777f579d16e2507

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 134290580f2465ea638c7425cdc68ffd20b9e69b918fb8355e532603f3aad43f
MD5 787a32ef8f4bdb990daea0319b3b0ee3
BLAKE2b-256 46ee01aa35eb3a731977459e7b72cbc9eebb6db41dad048a3bc9a09913a96181

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 435d7db1f7b20536ff2208ec53cf805f1bbd8bfb0e3515a494f33493ded61685
MD5 ef300a5952de35206343a4bb42fe6019
BLAKE2b-256 4bce85d14b40c1641cd0b7e799ff0413903db256eea92c92317535d5206655bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ca39ea635ad16d3ac8c33eec5a37aee4ddb2dc2d86aa199a652fa6114bffe3ff
MD5 33212e6846ea9a60ef867c5e16be2e00
BLAKE2b-256 f4270fae840f6fb551e08e50f8b0a7a3aa561d6ce60d115cbf24befac3ba34da

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