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 speed C++ 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
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.3.7.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

pikepdf-0.3.7-cp37-cp37m-win_amd64.whl (891.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-0.3.7-cp37-cp37m-manylinux1_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-0.3.7-cp36-cp36m-win_amd64.whl (891.2 kB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-0.3.7-cp36-cp36m-manylinux1_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-0.3.7-cp35-cp35m-win_amd64.whl (891.1 kB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-0.3.7-cp35-cp35m-manylinux1_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.5m

pikepdf-0.3.7-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.3.7.tar.gz.

File metadata

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

File hashes

Hashes for pikepdf-0.3.7.tar.gz
Algorithm Hash digest
SHA256 870c930e3450656b6da793968124ea9c509370deb413479652e0787b655d3290
MD5 2cb569b423f6e636fae80b2b68dc02d1
BLAKE2b-256 ea8d01f66685772025ac82c63c759b032d5df2a0714a7f59292c393a084cb42e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.7-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 891.3 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.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for pikepdf-0.3.7-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 80b0bab8ccb8e79d573a467a564963aac6aaf1f08b97f676f8562b4d400ff431
MD5 fc0768273592863e9ad8c3db104d8a1f
BLAKE2b-256 e84b4f64f0ad197582a244e4a428d1cc1b2cb790c5512ef1f782cafa5983080b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-0.3.7-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c894b456b21cef2f32c4d19680e08c415656f433f4b242aac65afb2e22a65385
MD5 a89526b2993cda7e890d6af1e84aa574
BLAKE2b-256 602f5b59acef7dc30350e1c040fe5ce74711429f7ad8fae2bfb8f9d47a50f5a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.7-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.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.7-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 6c68f90eae052ec6fb4e0a816c5c8f2146e5c0f229cab53aed1fb664be674235
MD5 65c39105b1ea304ad2901fac7579374f
BLAKE2b-256 0044350e45af343940d01e726b0028a94b265fec3c46d3cf95a33c85ef40ed11

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.7-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 891.2 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.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for pikepdf-0.3.7-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 83a8ce78be1fdb6a3123e02002558b0be5d99f9157ec76a25b2c2d81f5486837
MD5 1a5c12684f75f14ebdf9872cd0402598
BLAKE2b-256 2459caac337bf9636e2d684f5ba3a9ffc54b2e978fbd4d9aee82b88afd43a385

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-0.3.7-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1a1317d21e65d68a79e0432dee014cb8cea0190dc67364b42e91fe9211758714
MD5 e4d25c97b7317c98c90c80e2f33aa481
BLAKE2b-256 4b7407d3bc1b453a96294c8464e10e95a83cf4889ad18ff4f1388793bce22f86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.7-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.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.7-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 3dde6ffc6a1db48b7c0cd8eb0eee4b6bb7e9877265b237bcba6fb3a5b8779e8c
MD5 dbc6bd02b5b12269a51dd14bee04b30a
BLAKE2b-256 fabc870bc8c07e7af63e013a15fff1fdf1ba1efd1531959576cef8cbb56f39d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.7-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 891.1 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.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.4

File hashes

Hashes for pikepdf-0.3.7-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 8f5de8cf9bf3ae74521a7b39cf2602e365e28db5ca851e38c00e61329f85bd7d
MD5 184cb8508f86c3ff7f29d900bbc28c65
BLAKE2b-256 0708450e746de92acfaa4f5f2d67803b380b435cbb7c65c7733f404d4371c2a6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-0.3.7-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3b24ffb9e867ba6b89dde541030ba581fb2776d215d65d01593d697b3a388107
MD5 cd3900715e08fec7e2bf00b78188f421
BLAKE2b-256 bc76e159a455d1e03c6243747da4e53eb16d4d68707377e5ccee9afd23e2ee6d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.7-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.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.7-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 d56c6fc24b5c8d0628f0ba6f943a101a44251a46ce94d4f17fa9e42dd632cea6
MD5 6f57dd44b30503274066b50b1c501430
BLAKE2b-256 71d85e0e695335004607c88391ab5502af7a37d83f1674a889b73cae59a9a8c3

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