Skip to main content

Read and write PDFs with Python, powered by qpdf

Reason this release was yanked:

Use .post2

Project description

pikepdf

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

Build Status PyPI PyPI - Python Version PyPy Language grade: Python Language grade: C/C++ 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 Distribution

pikepdf-6.0.0.post1.tar.gz (2.9 MB view details)

Uploaded Source

Built Distributions

pikepdf-6.0.0.post1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.4 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pikepdf-6.0.0.post1-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (18.9 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686

pikepdf-6.0.0.post1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.4 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pikepdf-6.0.0.post1-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (18.9 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686

pikepdf-6.0.0.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.4 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pikepdf-6.0.0.post1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (18.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

pikepdf-6.0.0.post1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (19.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

pikepdf-6.0.0.post1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pikepdf-6.0.0.post1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (18.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

pikepdf-6.0.0.post1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (19.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

pikepdf-6.0.0.post1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.4 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pikepdf-6.0.0.post1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (18.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

pikepdf-6.0.0.post1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (19.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

pikepdf-6.0.0.post1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.4 MB view details)

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

pikepdf-6.0.0.post1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (19.0 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686

pikepdf-6.0.0.post1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (19.2 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

File details

Details for the file pikepdf-6.0.0.post1.tar.gz.

File metadata

  • Download URL: pikepdf-6.0.0.post1.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for pikepdf-6.0.0.post1.tar.gz
Algorithm Hash digest
SHA256 15ed9409e7e7955fd93f8023d1bdc980d2d2d4c7ac44205d6027fff27f28ded9
MD5 21cbe6903f1c858d61d73defb4cd8047
BLAKE2b-256 c06b3ff7fac02840bf97475c11434ddee915a45f2192d028da680c3a4c000fea

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b298894581be9a0c5c51c1872031215fd85d53eeebe20e59112a6b097d6762be
MD5 2e5fbfb5725a008cc2e11fe2a3d75a61
BLAKE2b-256 3f01ebdbd909eeaf9b2a70b086a537252849a92720b2bb4c299a5f2698269a1c

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 7db4a7ad9bcb1fda1561f06886c6fe127c1928b541418a4ef86385c7968998bf
MD5 0544ea6d62d4ceaa1913fbf4971f48de
BLAKE2b-256 bf4ee7345b7c641a35c6918e04049cd3bd3a59feb65a1255d05978ed1d90112a

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7bf0f2a12c9a8ec9bea2dafb1dca1255823c742825eabb4afa92c07e24862e01
MD5 f47f99ca39a493966d7c064f9217c8ab
BLAKE2b-256 2891f23ae75037e78a74074cc4a8ab5622ad4588525245def0baa85e122dd256

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 33da8b7484ca91c0df0765e867b9cd0c99cb6c31806efe2077ccd0fc7d6ccd0f
MD5 0390c5e3c559c801057363e0aad41fb1
BLAKE2b-256 ffe26cb80b2a2d70e7f9819439c4023c7a4252b5cbbdbf3308fa3339a8977a21

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 06f4f91ff411491a92b069b29a11d6b1bd2f2ca693cd5f053a0c5e2a3a3887e5
MD5 7d9e6b305037afba030f4794635f7dd9
BLAKE2b-256 b9822d535191f3bd9543ea7d64821c40f86e33644756fc1eb575d6ab962c7133

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5d892ecb429288f776b1aa5f0d51d527feb320c59a4c63c96266da35873757e7
MD5 36fd7323c3e1fb745f1d08557a923c42
BLAKE2b-256 53f8ef0d75eb73c3ed5f42bea08dfa342f36de570f86c30ba9883a88ddad0597

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9ce37568391ae5e4b972bdf56f1e8ee38a0697303d16c97f2e6f707819d527f2
MD5 3ca32495e14cec60e11d79382bb670f9
BLAKE2b-256 7649a069aa3f6e89e443add9809e7218ceb7a09689957994f5b5ce8f2c4d28b1

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d711d10af5b78526fa099c9a830a550809c23249c0bc623df9265aa1558043b
MD5 a55aa6b9a0a435cec795a1296d677abf
BLAKE2b-256 75f185d52c2a3f5ca296dfdc3476c8043e86a654d113bf241b1abffc2a10f9d6

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 2f06b533d67e2ce52779f02a945a2a758722ea6c8eb4915f2b6096e7e2c868cc
MD5 6de7cf1a045cb1cccfe84c44472ae7c1
BLAKE2b-256 052afe05d5037b7e88ff29e8872f584b6ca7271c8d468aaabf5e19a933e89fba

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3f4ee37d7b996ad472491351a1b09fbfbe8605b38a11a737bcb8de803ccb686f
MD5 018228dc8fc811a83fda0246cf283f52
BLAKE2b-256 15d68a27ac01f10edfeebad2f93f2c47f5945b8016263826ec9f6888228516a5

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca1e68ccf6c62522b3f0879d4961c7b4c2a9116fcdf670bac3ced0480da24516
MD5 d039de50e594c0f9eb2cece68943e3d5
BLAKE2b-256 2260eed6c6a5cefcc7c4ec49bdf63954d911b314760eb8afdc4361ec2cdf90f6

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b374aa7de33ef98cdb8e977268dd349bb3c31a04f35923fa89ee106824b30870
MD5 9c82ed73a9f414ac6351a63a52d488ac
BLAKE2b-256 20cbf92627ccfb15e7e5428bfe9a54804f75f459b718dca447caa009404ce699

See more details on using hashes here.

File details

Details for the file pikepdf-6.0.0.post1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 54fbc2d921815b852eeb058a129db141629c8aab87b1804d7b0c471ef37fa19c
MD5 784a1e79bd65f37d016fe0d52c869858
BLAKE2b-256 603213f122b96c5b59ddd837b2b3a706a8f8590e0e453f9663bbb432e8470e80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72a0b46c9d2299f7b10564acebfee0dbe16409088e88d7a1bc381bffd4d69301
MD5 2e43cf7614db588b7adde717feef3a7f
BLAKE2b-256 cba3bf6f7d14ef35dba255c0c015822607ee700ac5cbf1a36d1805e7c40b27ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 974ba73795fb305676a0ab57a2a9f57ae569dd3b7811cfdd8479ecce7a6b0c05
MD5 c307ae1e18e1bcf5d217df1fdfc96ce5
BLAKE2b-256 acfcc09a8ac35bc6ca3ea53d784525e6fe439729b4a30c6590d53adc06733b71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pikepdf-6.0.0.post1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a49ad193034c7f88c424e2c2842bdaf5518656fb0edda94f663aa9bf1d298739
MD5 52560609943c2d399ddfe65f0c070f39
BLAKE2b-256 00e317873f71cda6b64f62924b45c80ca32c971d744921ec78f46d7722032c5e

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