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.

Travis CI build status (Linux and macOS) AppVeyor CI build status (Windows) PyPI

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
pdf = pikepdf.open('input.pdf')
num_pages = len(pdf.pages)
del pdf.pages[-1]
pdf.save('output.pdf')

To install:

Python 3.5, 3.6 and 3.7 are fully supported.

pip install pikepdf

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

pikepdf is documented and actively maintained. 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.

Python 2.7 and earlier versions of Python 3 are not currently supported but support is probably not difficult to achieve. Pull requests are welcome.

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.5-3.7 2.6-3.6 2.6-3.6
Supports password protected (encrypted) PDFs ✔ (except public key) Only obsolete RC4
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 ~86% very low 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

In Production

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

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.

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.

The tests/resources/copyright file describes licensing terms for the test suite and the provenance of test resources.

Project details


Release history Release notifications | RSS feed

This version

1.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pikepdf-1.1.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

pikepdf-1.1.0-cp37-cp37m-win_amd64.whl (975.2 kB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-1.1.0-cp37-cp37m-win32.whl (817.6 kB view details)

Uploaded CPython 3.7m Windows x86

pikepdf-1.1.0-cp37-cp37m-manylinux1_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.7m

pikepdf-1.1.0-cp37-cp37m-macosx_10_6_intel.whl (1.2 MB view details)

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-1.1.0-cp36-cp36m-win_amd64.whl (975.0 kB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-1.1.0-cp36-cp36m-win32.whl (817.4 kB view details)

Uploaded CPython 3.6m Windows x86

pikepdf-1.1.0-cp36-cp36m-manylinux1_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.6m

pikepdf-1.1.0-cp36-cp36m-macosx_10_6_intel.whl (1.2 MB view details)

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-1.1.0-cp35-cp35m-win_amd64.whl (975.1 kB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-1.1.0-cp35-cp35m-win32.whl (817.5 kB view details)

Uploaded CPython 3.5m Windows x86

pikepdf-1.1.0-cp35-cp35m-manylinux1_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.5m

pikepdf-1.1.0-cp35-cp35m-macosx_10_6_intel.whl (1.2 MB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

File details

Details for the file pikepdf-1.1.0.tar.gz.

File metadata

  • Download URL: pikepdf-1.1.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.1.0.tar.gz
Algorithm Hash digest
SHA256 be826ba57db1a928ca0b95d7513e1c45cb7042ddf88adbb5f80881014d366391
MD5 cfdf17293ac9f880ac7a45f73fa2f5f4
BLAKE2b-256 d0de87be0b2b9dd5626d87df75f7f5ee04276cde661095eb4f854193eeaa32c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.1.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 975.2 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.1.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e85accfcc46e86be6e4db20b57a76b17cf92bdcaa603046e865405eb94f0f7be
MD5 b68860c957be8421c36ddb8959b86ced
BLAKE2b-256 0feb1e5798edbfa1a2b947da57c73e396f2478252632e6524aea652fefbe84c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.1.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 817.6 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.1.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 3114c73a678b4d1b6851d3cf05629ee96901f84541999411701648d4713a2f7d
MD5 578d54bf1964e1fb843a395a33873290
BLAKE2b-256 e2aa30dec2a222a15c3ddd8f97105810c6ce97724b905604a0f6c057a79295eb

See more details on using hashes here.

File details

Details for the file pikepdf-1.1.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pikepdf-1.1.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 9.6 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for pikepdf-1.1.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0c2046e99c8f64d07af241a2277dad37284ffa900cb92196f708bcdc5df0c273
MD5 e3bd28a66805404ae726492311b60d46
BLAKE2b-256 660d73607a2dadc6a126c84b2fa4c304f7de1b87e3d5f65527c82f995d663240

See more details on using hashes here.

File details

Details for the file pikepdf-1.1.0-cp37-cp37m-macosx_10_6_intel.whl.

File metadata

  • Download URL: pikepdf-1.1.0-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.1.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 de1696e93cb3af951de8bff5fd808a8245d890afe56af2a36fc849101ef82d74
MD5 3131458301c62b5f13325fce12c2ee8d
BLAKE2b-256 3587e032400d8119d1a6d5199558cb9e1799f0c0805a2794eca3a376e1e97673

See more details on using hashes here.

File details

Details for the file pikepdf-1.1.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pikepdf-1.1.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 975.0 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for pikepdf-1.1.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 2283a9b90a3ffac51be96dacaada65c98818c6eb2592bd4678715ec0c698872c
MD5 8e638a6c599684683cb4e95ee63eecbe
BLAKE2b-256 5f5a0e07665214b2d86acdd78acbc192473cbe1699eda3d8b7ec25815be68f0d

See more details on using hashes here.

File details

Details for the file pikepdf-1.1.0-cp36-cp36m-win32.whl.

File metadata

  • Download URL: pikepdf-1.1.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 817.4 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for pikepdf-1.1.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 d59e015ef107fc91d845f20e0306e31cc9afcd8465bc7bbc4a9f18778a16a2dc
MD5 f4fd7c911265a7ae3e8a28937e818791
BLAKE2b-256 aec419f9494d2503dd98154452c9031888ef1ff261a83eae750b05d3fc2979d7

See more details on using hashes here.

File details

Details for the file pikepdf-1.1.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pikepdf-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 9.6 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for pikepdf-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7b51724e72946f87f9ddb95dbf02bf23f80e24c42e3abbb21d2ba1921d02913c
MD5 03cdfd2557b2073e5559af241dc859d3
BLAKE2b-256 608bf63c48b5b3b7f2dd00baeb7d1e3da33596df3479242ca759f9a8484ca34b

See more details on using hashes here.

File details

Details for the file pikepdf-1.1.0-cp36-cp36m-macosx_10_6_intel.whl.

File metadata

  • Download URL: pikepdf-1.1.0-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.6m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.1.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 ab7db93eb806ea334c09fc5d40e64ac755d2e3750191fdc0e39fdf7671067635
MD5 f39e7a61b92d3a71d4fc9c059427544e
BLAKE2b-256 b9050bf79dac09d2509dfa2408bf837ded486f5c95eb16b1a0ef9943f10899c0

See more details on using hashes here.

File details

Details for the file pikepdf-1.1.0-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: pikepdf-1.1.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 975.1 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.4

File hashes

Hashes for pikepdf-1.1.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 a85638c66c8ce2f3db4b74ca7f74914f7b82d53bb6bbb64793c5bd3ed2e4af41
MD5 e29ed635db07287719bfdc33f9084bcb
BLAKE2b-256 29a53e7534b52b7bc883b0e1101f20bc55e3d1bbb58b9c0c566873622de102b9

See more details on using hashes here.

File details

Details for the file pikepdf-1.1.0-cp35-cp35m-win32.whl.

File metadata

  • Download URL: pikepdf-1.1.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 817.5 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.4

File hashes

Hashes for pikepdf-1.1.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 2f395bf13ab466cca847dc0574df65963091afe8466eb399a7195a72fcaa0768
MD5 09becf9b1a4113ebda33211c0c546598
BLAKE2b-256 917d808e536d6e258eaf6cbf87c82f628a0d6bc0ad405e4f51a7a3120a86e32b

See more details on using hashes here.

File details

Details for the file pikepdf-1.1.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pikepdf-1.1.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 9.6 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for pikepdf-1.1.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8f6040ce053b8f4245f2541aeb5d7cb1bfb4e8c8dbd78f8d440d0f2d9d30c963
MD5 805a777af36392d398e66a1a5d482024
BLAKE2b-256 e9972a186b2a696ed638a07a07ecbcf7721aa024be481a4b9f8974b74854c1e2

See more details on using hashes here.

File details

Details for the file pikepdf-1.1.0-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

  • Download URL: pikepdf-1.1.0-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.5m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.1.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 e6621ed403d724d8a41bf69588b739928732720a06c68cdafa4bb5c4021b815e
MD5 365f993553199d35e6ceb087e7ef051a
BLAKE2b-256 fc3fa983fa08667c9d59b5ec9eef235c1e6b72d46db263e23aefc3ef7039473a

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