Skip to main content

Read and write PDFs with Python, powered by qpdf

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 pypdf (formerly PyPDF2) - 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 pypdf (PyPDF2)
Editing, manipulation and transformation of existing PDFs
Based on an existing, mature PDF library QPDF
Implementation C++ and Python Python
PDF versions supported 1.1 to 1.7 1.1 to 1.7
Save and load password protected (encrypted) PDFs ✔ (except public key) ✔ (except public key)
Creates linearized ("fast web view") PDFs
Test suite coverage codecov codecovpypdf2
Creates PDFs that pass PDF validation tests
Modifies PDF/A without breaking PDF/A compliance
PDF XMP metadata editing read-only
Integrates with Jupyter and IPython notebooks for rapid development

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 Distribution

pikepdf-8.0.0rc3.tar.gz (171.8 kB view details)

Uploaded Source

Built Distributions

pikepdf-8.0.0rc3-pp39-pypy39_pp73-win_amd64.whl (3.4 MB view details)

Uploaded PyPy Windows x86-64

pikepdf-8.0.0rc3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pikepdf-8.0.0rc3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (3.5 MB view details)

Uploaded PyPy macOS 10.9+ x86-64

pikepdf-8.0.0rc3-pp38-pypy38_pp73-win_amd64.whl (3.4 MB view details)

Uploaded PyPy Windows x86-64

pikepdf-8.0.0rc3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pikepdf-8.0.0rc3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (3.5 MB view details)

Uploaded PyPy macOS 10.9+ x86-64

pikepdf-8.0.0rc3-cp311-cp311-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.11 Windows x86-64

pikepdf-8.0.0rc3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pikepdf-8.0.0rc3-cp311-cp311-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pikepdf-8.0.0rc3-cp311-cp311-macosx_10_9_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pikepdf-8.0.0rc3-cp310-cp310-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.10 Windows x86-64

pikepdf-8.0.0rc3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pikepdf-8.0.0rc3-cp310-cp310-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pikepdf-8.0.0rc3-cp310-cp310-macosx_10_9_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pikepdf-8.0.0rc3-cp39-cp39-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.9 Windows x86-64

pikepdf-8.0.0rc3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pikepdf-8.0.0rc3-cp39-cp39-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pikepdf-8.0.0rc3-cp39-cp39-macosx_10_9_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pikepdf-8.0.0rc3-cp38-cp38-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.8 Windows x86-64

pikepdf-8.0.0rc3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pikepdf-8.0.0rc3-cp38-cp38-macosx_10_9_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file pikepdf-8.0.0rc3.tar.gz.

File metadata

  • Download URL: pikepdf-8.0.0rc3.tar.gz
  • Upload date:
  • Size: 171.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pikepdf-8.0.0rc3.tar.gz
Algorithm Hash digest
SHA256 b082c1bdca971ec195eb8ed7e6eefc1e8f44ba446dcb8fb2e67bff9e062121e1
MD5 e5fee3481594650be5e9d11961fc6161
BLAKE2b-256 e76f8063f2c5222a000e615c64301156a4f0f16c52ef7b939f049895572e7c21

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-pp39-pypy39_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 0ad879fa1b2e10e9f570ec9074e52c850fb8ea4935dc1f641098c0d6fb41f5a0
MD5 5413b74927aa653e685761965166ddc8
BLAKE2b-256 d0b8d9b50bdc71be62edd5f9ae418e5aa9838fa4c75ec474acb22f74d36f805e

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9095e3d4958990ecf6d5f6bd82e5bd7118c1679ee567d5afa3a0d554f0436398
MD5 f4d8abe7d13f977677677317651adb02
BLAKE2b-256 350c05c84762debce65d990bf1179e3cb978161ba7758d8e8a1df0f765057f01

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 de65648dbdc1953b234c9c90e43fa35dc4d696ee2448957ff93c62ab1eb1d314
MD5 d35aae1460a8a57fc89796814740b9aa
BLAKE2b-256 536ce7c9c830f8bfd79ae4a752ef7845f28eddeb64c30fa5572e421170987fef

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-pp38-pypy38_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-pp38-pypy38_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 3e0fd3d6fbf91dca815ad6661431a801d8517b29b7a4b6dc4dda404ad25ff2a9
MD5 33a6c7c35bfae15888b60d8cd397743e
BLAKE2b-256 ae88f994d4bc257bc68d248b8a0883869ba481923d419edb450439c719169cb4

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18dba95cff130af1f89d3cf2c5a5424a45bc631e2165a68b21a727d08db94615
MD5 0ecb74cd6bf24f24bf63381071723e51
BLAKE2b-256 3db4c1b2c89c53f7c70278d530c1e77b41388a7b8b9d4a53c2d31138e035e9bf

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 93e80584e6cbb903cfc65c40e35c82ba1a1f05c96e56928def0c5417c8d5c4e0
MD5 8affc15bbc48a49e3d88f907ca911d5e
BLAKE2b-256 3d7b9888d344e3b13a9ba5e532df9732638f7dc4a1c9f323d08904243b1271a5

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 04d6454fba370368987927413752de3b83b6ef89a65d72dcc851021acd902b9c
MD5 87ea8b925f728e27ba87bee76eb701fe
BLAKE2b-256 8b1e68143db7001aee388af62c365371042db807f470e30135ced75043865333

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d3a3bd11181b5cabf34826266a81b9c84492fe34c522f48360949415438af1a3
MD5 6085a00b8acc44411992693bad91bfb8
BLAKE2b-256 cfbaec0a0134f76f83583332700468b82772d781977a00031a1cab561aa1a6c0

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c2f478838a438f181342f10b3adb0039301f6e86cebcdcbcdbbc4c12af0f5626
MD5 1afe908b5ceadb10c71207f0b3f016b5
BLAKE2b-256 7a52c0eababbe048bf7b844c3c57cda989f23624fa56139bc57caded4127bb29

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7233dd0e1abadd0bda9a36704528ad212f1d4def560f892ede535db080c15310
MD5 ca47e7939871c17e726540cb9893db1a
BLAKE2b-256 b75ac0597586d2053a1b3f28135cb8d43117f2394accec62a63be87aa8b022f4

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 326cb5934914df521fa1bd55be001b6c0b508c85edc4225146225938cb61d28e
MD5 edaa534bd4174261e9fb17afe3fb1cfc
BLAKE2b-256 86c4f5f500311817b61e4e6cec74cbdb7e5c48c850c9c753c94bc11dd0772244

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f42763338bc659f9a206bc4f8cda5f0335e6dfed16e998624370accf4e5fe55
MD5 9edaa7590e644560f523e1492d71cb87
BLAKE2b-256 bed5b3e021518ef2dc6d86bb690da820dbec58dc320524cc14a01d088e1b48af

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 743196e50935844e9d1d8ef8f7fb12f721f4f2c0b5e6f8c081a2b58beb54225a
MD5 dd61c4acce3995f8ce81c8fdb9cf52a3
BLAKE2b-256 8dfb653991e32923ff4fdc41a7303e6af61a4b1934cd8cb2106bbaa6db13d9a9

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 26d9defca91d80ff3de38c7d114c674b7e210211a831f6491dcb50a65a2f4496
MD5 c5b869fcf111b849b1d0910f0099c4c5
BLAKE2b-256 5f8a8381b2c9b1935d744acfd2b2b11a1685b41f865eea8fe5b2abba0e508a95

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c9cc486631cc12862efdb302baeff53a1f94983cabb1da748a4ef1a5053e4ec6
MD5 1bf83ca09206d618ec86599d86746357
BLAKE2b-256 9b09c8e522d261b8b7e20bc7e27b4ced62a7ef09f8c8f1971c9fb67535b83d8d

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c9bcd99f72d1e259d29c9155a5afdb2e6d12d255d63675e172ddd6c3a837ebc8
MD5 936252b044811512e977293a324096b2
BLAKE2b-256 af43907bc29e469f00bed9c01592147188e5d60453183f26c33e972a44b72057

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9386e6cbbbd494dbb3b221dc9abf2799807926bdbe5f7f2efc2922b1a5529dd
MD5 702178450c84f2dc347c26ab67ddee22
BLAKE2b-256 57dc263bde86d99cf30c4f9c4553619b9e402f15c8e11671bcfe1e53251fcebb

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 53c6d091c73be74d05a62dc3d8f2ef652051b57cb2bf426410d5d65fa1237386
MD5 d3e0decb863d922af07c7f2fe43116ae
BLAKE2b-256 d1de41548f5391507bf8ab9e968704ca1d07826439150455ad3931a737a7bdce

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e25fd6ea09a4381ad8967bebe09566e17028a9a245687907b1985172a3d9b0d4
MD5 7a386920aac2346ffb20d51830762ca2
BLAKE2b-256 eb8f49ff66385d11fb10600e8d9f952d98d6d268ea992dd5aaec71816a44de4f

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ecb49bb9d66766fcd52aa0860b3e13e6ad4ddb4428a0e8f91e277aee78e4c5de
MD5 a216f8ab4504cbd8e7b22cf4dff50a61
BLAKE2b-256 5337e4b010557fd44a3e1d8c5d2a45cda150909577ddaaacaf35824a3b176b96

See more details on using hashes here.

File details

Details for the file pikepdf-8.0.0rc3-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-8.0.0rc3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1d0ae7502039945243e061b8393c81b9b4a60ae3e0339a1d042b0e56455331bd
MD5 8609a8030cc2290949cc3297bc6603ff
BLAKE2b-256 4fd9a7939fd000c0eeaa5f4de10e29d021ad605dcbb4287e7e7f6f5ca9e59ae9

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