Skip to main content

Python bindings for the PDF toolkit and renderer MuPDF

Project description

PyMuPDF 1.20.2

logo

Release date: August 13, 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 online. It is currently a combination of a reference guide and user manual.

  • You can view it online at Read the Docs. This site also provides download options for PDF.
  • 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.2.tar.gz (90.4 MB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 Windows x86

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 Windows x86

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 Windows x86

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

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m Windows x86

PyMuPDF-1.20.2-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.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: PyMuPDF-1.20.2.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.2.tar.gz
Algorithm Hash digest
SHA256 02eedf01f57c6bafb5e8667cea0088a2d2522643c47100f1908bec3a68a84888
MD5 450f0c613fec4b0d061299d3d935fafa
BLAKE2b-256 4a096afe87a8ea7acb6e4709223a704270ffe9929497add4d06b12305e229ba8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8074f005d247bbb6b43c0c1eba2a316d97cbf8345b456d37ee97c9cd2a7398cc
MD5 839c8907fd1c66188d57aa48594d8c65
BLAKE2b-256 f552c123cd52b74bc795acdc5affb63cea00ffbd2ef8ea4b7c9c97bc6b032a2f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.2-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.2-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 1df02cca0fbb64c3dce4d6094f9ad91991d768ebe0c0efdee85294c7959db7c3
MD5 72b5078031b5b8a44f2475a2d793c1ea
BLAKE2b-256 4e20254e9579ad68775ddf1856ec240ade873f40d24e67efbfa195b41e227ba7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73dbf73ac1c5cbf99dec903c98bc18eb30c8fe1d703ec5531296a5308700f001
MD5 d9e0d2e7c7b596baf4800152ef38f72a
BLAKE2b-256 57a7e3f2ee590766aa8c923b9580ee7dc9e2c5cec3b1f00456e66ec8a47192d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2a82438b44723e7dcb47d156cf0299fcf3d09e970ee469081c3f9d79b8c40ce3
MD5 61f957521e600b47b9613a866ce709f8
BLAKE2b-256 34641fddfe6b4df8084dbd74d86299ab6083feecaf006ae03f3b68bbf782ac6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 18077adb58b7004bb396f952d27c89c6bf5dc521b4056ba4f95772c7e900a57a
MD5 30a6d37538913ecf3fb77f507a7d9579
BLAKE2b-256 eb63eed27df818b6f579fcb9ac58e435c3aa8fd40300bbb48c87035d6db74e63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.2-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.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e9cb960e234498a4e91e4b56e2e71f4c56fd0045c7a71315df8e03a33212dbeb
MD5 7537e757de9ed3e66d96532e19bcfbe3
BLAKE2b-256 f2a213216bcc975c107322a62536452116f9c81eb305c9bdfdc460e5d38efc1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.2-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.2-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 e7214cf1870238d39ca008eda7c612b1db7228d7e913cb1a028e7a28175bef41
MD5 7d9d2b98a03f2100c0ff2244eadabf7d
BLAKE2b-256 e1807c732a7f66998f2ca6871f47803caca6af44f73637aa0ac97f53525f8b44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5c0ee0df665849f8686981fcc8f836afac2302bb6a7aaf330e73fd5694017d9d
MD5 e965088bbf971bc6c2409873a9c196a8
BLAKE2b-256 68296e7a908db60d4d653ae68553ef2faac3943204d94efdd63cc0aa1e37fa3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bddf7d617fba1b345d9aee8d533888e340ffa3f784910453608bc5541089023c
MD5 e733bcecee07f3e051d8d3d76a7bc959
BLAKE2b-256 f831037e95c81f98c8e3011f159fd486cdf05ecc6706721cc430a116c935acb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d5afa38414c3cf10daaa627f3fc7e8653efbbc2e5f58335a37e743a5c52698d0
MD5 723f254eb299739fc652aa88d461214a
BLAKE2b-256 642bfdaf02f7127bf30b9fc9da7766ed2b1c422e197009804f109e4f1a7544eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.2-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.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 071732c5139150f1f7ba95d25c0b69919dee8494adc88a914872da5272b974d7
MD5 90a59484a75e8d7f1fb0f0d58364b20e
BLAKE2b-256 c132157ea2cfd468071e860b5d9821c523ecf914ab20e20fbfca0e273cd3ddcc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.2-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.2-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 2af5b16d2f7f78a8800906e30d650dbdbf38209e988e0796b57d1a938a59209a
MD5 e882bfd14f610aca2e013a54a9e026e9
BLAKE2b-256 38756bed6f33c9ee9ec7ab7c22527649ee0fabc06d6e93bb559b94a73287b1b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f2897fb4160b5fe2f80739ca9e101677e5694b5dcfda8026b0eb0b7e2db5615
MD5 d24930dca578da4061c2b7d6c6a96dc0
BLAKE2b-256 1a928944ffdccc43fcb775caef8d3762e86136d758102f830a319af5fda1c467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7d29a7db4b15dcb7632bb6afa197f12f95244ab15f7c73ccb219e3f7df4e79fa
MD5 10e41d7866e04e88ed5074f3e9a8207f
BLAKE2b-256 2e56454f1e47e4fb4e0f857e817e068741b5c2c3446e9a5eb1c178ae87c6261d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 61b07f6c389c690f28c79830a14c294bbc1679bd31edc4b6a42511c415434cbd
MD5 d7c1940572ae182842adb89f887ac232
BLAKE2b-256 e850c4963337bc22b134e568e9a13301513e69be2a3d38e7b3473a430cfe842e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.2-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.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 acadb4e61776cc2d6dd0196675db324411fccd64e8d68399dc8e6ca2cb943f49
MD5 542095cba0c2981950fabd483f97744b
BLAKE2b-256 2a9013d45eb3e41232843939840a5d42670db159a4c8d9de46db1ebcdc22ba74

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyMuPDF-1.20.2-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.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 1bd2004a64f110dac255a86ec45245f17e84d81cf6f8f67608e45455cd1b5697
MD5 b34840a2b7edc2d194c0879c045f0be3
BLAKE2b-256 6bbef64ca0d3cc3463631979955b94a8b43a6af51230d630b5b5c8024dc0c540

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6c50b8408dbbb921cfce7145ac0ae0e150955f9b2deed8cdddf03e830ca1e6a2
MD5 28e1ad97cc8f9d27511579eef62e1fd4
BLAKE2b-256 fce85e9a0a148ef2e88ef40af0e124efd05cdf4f17f9be61cba7d38241fca286

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5824103cf2ea3b492cb5b3c66ab16d61db65363ebdfb7ed28a2af93cb48dee4f
MD5 02b0f86124216b863a56b939e3c9c10b
BLAKE2b-256 a7377eac8ffdf529d880ce224bfb922544878905dc8fb9367bb909640fe1a89e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMuPDF-1.20.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4045847e830598269be448bda21dc8ea332fce974c4cf3b1b6ca0d6231f2de0d
MD5 c4194f2f065c1d73aee83dfb758df4c9
BLAKE2b-256 e8e7424895800fcff73d3052fe8269ace14351a36ded97d57c929504f0854a97

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