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

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

Download files

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

Source Distribution

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

Uploaded Source

Built Distributions

pikepdf-0.9.2-cp37-cp37m-win_amd64.whl (904.7 kB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-0.9.2-cp37-cp37m-win32.whl (771.9 kB view details)

Uploaded CPython 3.7m Windows x86

pikepdf-0.9.2-cp37-cp37m-manylinux1_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.7m

pikepdf-0.9.2-cp37-cp37m-macosx_10_6_intel.whl (1.1 MB view details)

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-0.9.2-cp36-cp36m-win_amd64.whl (904.7 kB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-0.9.2-cp36-cp36m-win32.whl (771.8 kB view details)

Uploaded CPython 3.6m Windows x86

pikepdf-0.9.2-cp36-cp36m-manylinux1_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.6m

pikepdf-0.9.2-cp36-cp36m-macosx_10_6_intel.whl (1.1 MB view details)

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-0.9.2-cp35-cp35m-win_amd64.whl (904.7 kB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-0.9.2-cp35-cp35m-win32.whl (771.8 kB view details)

Uploaded CPython 3.5m Windows x86

pikepdf-0.9.2-cp35-cp35m-manylinux1_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.5m

pikepdf-0.9.2-cp35-cp35m-macosx_10_6_intel.whl (1.1 MB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

File details

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

File metadata

  • Download URL: pikepdf-0.9.2.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.9.2.tar.gz
Algorithm Hash digest
SHA256 4072a51195a4554882ef76d8f59d980a1f64062e8a7852442190b0f26ff5056c
MD5 3b6f6fed42d0216b2d26452649753e62
BLAKE2b-256 240f42fffdf649a795d7af21c0445b1880c6793ef86e0bfc0977b868a353dcef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 904.7 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for pikepdf-0.9.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 761d6f7f1d5e356ef0706df042fe4a5c2b2690b3cab467c32c2e3df38df657ee
MD5 56be1d500711ae63eab4b0e01a6b37c4
BLAKE2b-256 383da6324386c5b7a1771051566317f1515d0bcddc4f7758a1928dcad9841398

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 771.9 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for pikepdf-0.9.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 57d4d3a5be16841e6af27c3237a8892ff5dc9455a7b02f4a0097c3d26cf94e52
MD5 1fe5465242a3b333795b583f2b7d1629
BLAKE2b-256 396572fd9b098f3daba2348969b56670a87acc6725ec0553bb27e79f15ae8a68

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.7 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for pikepdf-0.9.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2397be5fa1749db36c2141de12724d4d1d4a5053e4e01be942f0bb538dbf14e2
MD5 00e8e78377bc4d082ee7b0f8dcb4f5a7
BLAKE2b-256 99060f6429621207a56e915e623271dd8decbcd8b149c10faca548b8524b81ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.9.2-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 bd60ba066388e974f35031df37af2f443a820e180fff176f54cde4e0a7d2c6b4
MD5 e555ce02800731aa7ee5d9950e253871
BLAKE2b-256 4641b670a4cf700878aeab3ee6513fc4835e9459492371db5ac5b8fb1eba1bad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 904.7 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for pikepdf-0.9.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 5eb8e90347b4ead4fd1ab14511d8708cc328ffcc2a449ad1508f8e6a1c251d10
MD5 ac9d523365e928662bfe7952e7510e60
BLAKE2b-256 798394e6d949ddd27367b58255586af2acf7f712c638bb98799e6772409f5d55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 771.8 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for pikepdf-0.9.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 1c6fedebf8fe6a480d73f9e1c45ddaf6bcbcb39e86e4b3300beae294e86d1e32
MD5 3e7826022c5dda52ea9d79bf081677ea
BLAKE2b-256 2aec3fcb22e4df0009d189391ce8d273c60f4353fd249199a55dab1f8e838624

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.7 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for pikepdf-0.9.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8268db250f4038821dce2c3b7c00d96553c5e170b91b9b6cba79aefc03786c3e
MD5 c215d2aaf2b2ba972460a4a591c91676
BLAKE2b-256 ad6945ffc0672dd1dd08fe3181d9f5f643ee16a57538e8458d76552a30b72adf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.6m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.9.2-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 601613ceef72c2ef27f94e01ceb2ba97f7a46b195222d5fac937c965eb95d4cf
MD5 24faee831b1d76c21d51babc2569a75a
BLAKE2b-256 228311b6b4c005de0987278461a6ae4fe49d24da88a1f482f4e302090662e989

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 904.7 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.4

File hashes

Hashes for pikepdf-0.9.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 293c7c0753dfa9763073ab53ab52ff7f2c9a948d8f3a8bbe8b7d7e520532c553
MD5 04c5edeb28af587f749d5311e95085f0
BLAKE2b-256 345ab0ad6c1fb347d634e420ef99de17963e2d8cdafd29fca4375061848b79d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 771.8 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.4

File hashes

Hashes for pikepdf-0.9.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 bba059d3ea12a19450fbbf302ad2b1dc022414981fad51b484edd2f1856cfc3c
MD5 670605a1f2f3ebc0f9a0ec3ead7e0874
BLAKE2b-256 a362dc401e06ce1bb4dce9512f033d7bebf1c01f987ec0286937d0e7ef4d7bf2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.7 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for pikepdf-0.9.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3b6e2f4d1d5cbcc77fac5d343d789d1c63b68a7afe7d7059c9ac50d983630f99
MD5 1bccc82211a26aef7391fd2d887aef4a
BLAKE2b-256 fcfba6522da9be024a6edb87e76da39e74469fc9d395e1ab0eeff8b7d563333f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.2-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.5m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.9.2-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 8e709b4492deb15f6da2be734ebe6a3bd887e9fdcc5d1061ed43b628866cd1c1
MD5 af5902facf6b84abc879ab5f188e549c
BLAKE2b-256 a6345647f1238765c5b1ff18672cefb0537cda920766065a27a5ad018a5c1a2a

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