Skip to main content

Read and write PDFs with Python, powered by qpdf

Reason this release was yanked:

PyPI quote exceeded so not all wheels uploaded

Project description

pikepdf

pikepdf is a Python library for reading and writing PDF files.

Build Status PyPI PyPI - Python Version PyPy PyPI - License PyPI - Downloads codecov

pikepdf is based on QPDF, a powerful PDF manipulation and repair library.

Python + QPDF = "py" + "qpdf" = "pyqpdf", which looks like a dyslexia test. Say it out loud, and it sounds like "pikepdf".

# Elegant, Pythonic API
with pikepdf.open('input.pdf') as pdf:
    num_pages = len(pdf.pages)
    del pdf.pages[-1]
    pdf.save('output.pdf')

To install:

pip install pikepdf

For users who want to build from source, see installation.

pikepdf is documented and actively maintained. Binary wheels are available for all common platforms, both x86-64 and ARM64/Apple Silicon.

Commercial support is available.

Features

This library is similar to PyPDF2 and pdfrw - it provides low level access to PDF features and allows editing and content transformation of existing PDFs. Some knowledge of the PDF specification may be helpful. It does not have the capability to render a PDF to image.

Feature pikepdf PyPDF2 pdfrw
Editing, manipulation and transformation of existing PDFs
Based on an existing, mature PDF library QPDF
Implementation C++ and Python Python Python
PDF versions supported 1.1 to 1.7 1.3? 1.7
Python versions supported 3.7-3.10 [^1] 2.7-3.10 2.6-3.6
Save and load password protected (encrypted) PDFs ✔ (except public key) ✘ (Only obsolete RC4) ✘ (not at all)
Save and load PDF compressed object streams (PDF 1.5)
Creates linearized ("fast web view") PDFs
Actively maintained pikepdf commit activity PyPDF2 commit activity pdfrw commit activity
Test suite coverage codecov codecovpypdf2 unknown
Creates PDFs that pass PDF validation tests ?
Modifies PDF/A without breaking PDF/A compliance ?
Automatically repairs PDFs with internal errors
PDF XMP metadata editing read-only
Documentation
Integrates with Jupyter and IPython notebooks for rapid development

[^1]: pikepdf 3.x and older support Python 3.6.

Testimonials

I decided to try writing a quick Python program with pikepdf to automate [something] and it "just worked". –Jay Berkenbilt, creator of QPDF

"Thanks for creating a great pdf library, I tested out several and this is the one that was best able to work with whatever I threw at it." –@cfcurtis

In Production

  • OCRmyPDF uses pikepdf to graft OCR text layers onto existing PDFs, to examine the contents of input PDFs, and to optimize PDFs.

  • PDF Arranger is a small Python application that provides a graphical user interface to rotate, crop and rearrange PDFs.

  • PDFStitcher is a utility for stitching PDF pages into a single document (i.e. N-up or page imposition).

License

pikepdf is provided under the Mozilla Public License 2.0 license (MPL) that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license. Some components of the project may be under other license agreements, as indicated in their SPDX license header or the .dep5/reuse file.

Informally, MPL 2.0 is a not a "viral" license. It may be combined with other work, including commercial software. However, you must disclose your modifications to pikepdf in source code form. In other works, fork this repository on GitHub or elsewhere and commit your contributions there, and you've satisfied your obligations. MPL 2.0 is compatible with the GPL and LGPL - see the guidelines for notes on use in GPL.

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pikepdf-6.2.8-cp311-cp311-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.11 Windows x86-64

pikepdf-6.2.8-cp311-cp311-win32.whl (2.7 MB view details)

Uploaded CPython 3.11 Windows x86

pikepdf-6.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pikepdf-6.2.8-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (2.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

pikepdf-6.2.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

pikepdf-6.2.8-cp311-cp311-macosx_10_9_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pikepdf-6.2.8-cp310-cp310-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.10 Windows x86-64

pikepdf-6.2.8-cp310-cp310-win32.whl (2.7 MB view details)

Uploaded CPython 3.10 Windows x86

pikepdf-6.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pikepdf-6.2.8-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (2.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

pikepdf-6.2.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

pikepdf-6.2.8-cp310-cp310-macosx_10_9_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pikepdf-6.2.8-cp37-cp37m-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-6.2.8-cp37-cp37m-win32.whl (2.7 MB view details)

Uploaded CPython 3.7m Windows x86

pikepdf-6.2.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

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

pikepdf-6.2.8-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (2.7 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686

pikepdf-6.2.8-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

pikepdf-6.2.8-cp37-cp37m-macosx_10_9_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file pikepdf-6.2.8-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pikepdf-6.2.8-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pikepdf-6.2.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 698dd313a8db9f71cb9f3994b24cb7992107eb6283a490316f4ad823049a9f2f
MD5 2cce76ddb36f5849d5098d5c9e94c1fc
BLAKE2b-256 7744294d348cc719fd4f1436e5d0edacefa15dd88b8d32029d5e76b7f9ce776f

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp311-cp311-win32.whl.

File metadata

  • Download URL: pikepdf-6.2.8-cp311-cp311-win32.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pikepdf-6.2.8-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 2f1398cc139e1aea0e2aa6c7304493116e3c377853e410994a243597ac651b01
MD5 3009f6b08270831fcab81a6dca92a711
BLAKE2b-256 18eebd4972878dff55d8f39a099a5040f865b013da4a978c2a4034c490584139

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3cdc553c49ee5e679f914926223ca76a3af485c9433e385b8fcfc23ac075210e
MD5 7e0fcb8da0d5cb847c5e96f4bc3dd9e3
BLAKE2b-256 6fd421daeb4411ddf06fe9522f093b1312cfb05112b34cf6437d66c3996b1e4f

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 1f6f9f1bb2fee9d34b0058d32469e82814804e54fb42029448b3d7e01f3fb403
MD5 ab0e75610139b587194b734d2350fe10
BLAKE2b-256 ba5cf3be6596645312daed0ad57c940941acbd1ee8861d9b39428f636c143f33

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 99d26e0ff752653fe7f67de165d2191f4c5049b6e55214400f193116547dc38f
MD5 f6eb3fb323a92616832a5b08f21fa061
BLAKE2b-256 e6fcc04686985539f6b129307e056d337bf1cc50afbe5bb8884d836af076fb9e

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 51e25049c6d757050176b31259917060c4e37ea1754fc87e15d94c6e366d85c9
MD5 26f8a10705f867e69e68064a504f839c
BLAKE2b-256 f5bd9518e146e67819f2f7deadb67af6f84a533a8ce1308201534386aa88eb6b

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pikepdf-6.2.8-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pikepdf-6.2.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0b272eb340f230315efd2821a98419ec1d4998d714ed8e7697b8c9bd69639df9
MD5 fc3761b69a3c8d48093bb4f376d7d0f8
BLAKE2b-256 b989a8da5b8827d12ec0bb5a76750a6c3b28b9e2470eb485b244fd19fe722954

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp310-cp310-win32.whl.

File metadata

  • Download URL: pikepdf-6.2.8-cp310-cp310-win32.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pikepdf-6.2.8-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 e0826434eb9cfa756ccbbf8c91f455ca9ca80c1659d742d3076b5287ad0c0466
MD5 9338f7727fd5a0d0cec984cf6f162de4
BLAKE2b-256 1fc8b724a3fc11a5686fa2313a84824242b7e7d0b5d0d7a19f31c52aaa877ad6

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 80e1ec42e2bc33815c87d47f27b39eb524b698d99d55eba2d5d582268a4d0840
MD5 e7ceefc58ecb7824d1c2ba8ed524e8d1
BLAKE2b-256 37e09c2559d50f3c63e000a30a477ed745b461786b9d7e0d208cb1526c8c738a

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 fe79befdd6483d267f604d9dc927e319a490282354f9d5bcc5141a382aaf0969
MD5 f2098995414e116b3e981a451bf4599f
BLAKE2b-256 76b0422fe6362bc78990a2d89cd84f83142f03dc17707d88a6e1f7e6e0f0a275

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 da8cdb55a8e9ab1c1c2f6e9bc5befdd9df2e591322b3ca745a8ad8b7572d0e90
MD5 f80ffc18a8b29b97076794e8ef3b8320
BLAKE2b-256 e0c846a170d70a6e33cd6e4025f94a6c218b823e191419d64310b6f1bdfc651a

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ffb4ad5f6eaeb4a21f0942b5f1f17c20d1c7cb75fabeba147ec2e9342eafd060
MD5 d22dc212c486abc947c2ca87839050e8
BLAKE2b-256 9736b7fecd5395091c43b75ecc4386241eb4563bfc3314a9dc53fea121ef50d0

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pikepdf-6.2.8-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pikepdf-6.2.8-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 f5d670fab1c0faa7847631accfe712c18bf6f3c27a9d73052e8dff4b6841dbad
MD5 9ab5fc906a8e93fd251cff133b933b00
BLAKE2b-256 0360f9f0ef02f646525a9cfbfa46a22dc59da865c2419672ff5b481ece7d6d20

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pikepdf-6.2.8-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pikepdf-6.2.8-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 33a4c637386fab27d42a0a48ff8da1fe5cdb81b21895d5e1c4f738efd321c998
MD5 c045d11d9682b0b02f42414fdd7cffc5
BLAKE2b-256 2a2959a50185c5f920ba0f9fe44df5bc5a3472f3cad0526601fdaab9eddf472d

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 25b197aba87fce8400e484847645b5204db5f32fdd997dbb6c394cee457c0e50
MD5 393ee2f10dd932469530dadee1eda63f
BLAKE2b-256 c570c6806c192fc12be0229a523f74e559afb33e5db3ba85dfaccc1a066faf43

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 16bbd82ed927885f5ca431ece447cb0f14d5550b90c879e18953a4ae192cb291
MD5 31ba2c8a0dff019d82bb5ce84f183f95
BLAKE2b-256 ca03b7d4277876431a78b67b8fa8e9d3985f5304de0b7e617921d164c675ccfe

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f50b6c5e2aba6b8787926ee9761e2fc1865bbadfa5ff7ae7f6b77d135f2a11f4
MD5 5a9720ec014fa89605a875fe3c4294c2
BLAKE2b-256 4c62a8920ba354225e45611d1b1945b7ddab8e6796a07904c87f20b58d593ac6

See more details on using hashes here.

File details

Details for the file pikepdf-6.2.8-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.2.8-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cdf6ac40bd18ddbbbf96b141d9121b532b8c5dcd55ca862dd04da0a0c80e527a
MD5 92c3679d9bb72ddecfcd92ff3ab72b46
BLAKE2b-256 65349896c73e7fc62ce1f6d7d5ccf6ef049b15be984e779a07bcb439164630cc

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