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.3.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.3.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distributions

pikepdf-1.3.0-cp37-cp37m-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-1.3.0-cp37-cp37m-win32.whl (839.0 kB view details)

Uploaded CPython 3.7m Windows x86

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-1.3.0-cp36-cp36m-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-1.3.0-cp36-cp36m-win32.whl (838.9 kB view details)

Uploaded CPython 3.6m Windows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-1.3.0-cp35-cp35m-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-1.3.0-cp35-cp35m-win32.whl (838.9 kB view details)

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

pikepdf-1.3.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.3.0.tar.gz.

File metadata

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

File hashes

Hashes for pikepdf-1.3.0.tar.gz
Algorithm Hash digest
SHA256 f6db680c47e01ab23ee813d7c0e2bc50469a6a9f4a33414e961d07cdec0ed541
MD5 bf1bfbc23a7e4a3497154c7b08ebc321
BLAKE2b-256 04a00951cda6ebdf3d205af9b177250382e3c149a96b82d0ce75e984310488e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for pikepdf-1.3.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 7919a28e3437e903954dbe839c909a7bd36e3a033545104e0aa659c64297c56e
MD5 6e3808372f5a6bb71a163b29d668f3d6
BLAKE2b-256 f469069e340f6832f1a1fc6fbc881c0dfdeaffb2f741c1d4797a55b2e949c366

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 839.0 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/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for pikepdf-1.3.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 416cdb9e64d461ee6e25f4605d31c2d8de5edf90830556b6f9d35698dcc18838
MD5 3665f144d74eec10136e1956de5a8355
BLAKE2b-256 332e7ad6b88055d8d84dd405542cb54b3b5642d3f48c22ba7e7bb9f82f510ee9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.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.3.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 26174050dd0efea0d8f291636151dee5fdce2d8b9bdb4d69dee9d92e6d0af072
MD5 ba33b625ff896a98470d9e5ccd4c3249
BLAKE2b-256 d38fbc582d5f80d353cc1445ad365d2350e3766408fa3707ee23ce6a20c44503

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.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/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.3.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 38917e82b93f8c127f11ba28e63c8e6b8443246abb2ba10025288d0d74f8d197
MD5 f1c6690c57e62865d702b0cdb491b76d
BLAKE2b-256 51ac5d0059a88e551a08c799e600bb4c54b2baa4fc977597337eb0132a09281f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for pikepdf-1.3.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 66d1fc20bd230dfa04e0b0b1cae23b8aed57934989b4c77177e8f5589608382e
MD5 4d868fed3b755983260b754d14d55ed9
BLAKE2b-256 36ac3b2ff21ddccc862e9e47a9b330cbdb9ca69a60e709e511184003b5a9996f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 838.9 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/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for pikepdf-1.3.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 a8978dd51ead64c33c3d60b0000d7988f6764c9018bec0d823bbb2ce7eb80e15
MD5 4b41e6666149075d3b1edb4292c04584
BLAKE2b-256 7ffc8694f545e409efe19aedc56da5edba7c084479727b2507639b07e8afdc6f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.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.3.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b165534c400bb142b6fb1c18a8ae52ee8ee39ce242eb1eb52a140d16e0f286d1
MD5 1abeef657cbe6b19321fb2d11b88bde5
BLAKE2b-256 8162f8c14b826cb089b07f7291ae796b24554a9c863a7d79979422c81c2fc854

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.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/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.3.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 18b6fe66911bc5d6f1cda9dc0c41fc408ade3ccb8fe25a6dff5e690eaa341fc1
MD5 02299728f97a3d39b832482917458a4c
BLAKE2b-256 f66d3913ffd4414254abc28f0ea4505e20a4042707ea92f0619dd6f37f71635d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.4

File hashes

Hashes for pikepdf-1.3.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 86465a41581bc26a63b302a68f2e40800a5cbd57150a4cbfeed2685635f8089f
MD5 5320fe35a0527b3148e3eee4b9d66410
BLAKE2b-256 7ec8dbe6fc3c77ec960d0522b5d7d537975d84332f5598fa1818a42fe885c5b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 838.9 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/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.4

File hashes

Hashes for pikepdf-1.3.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 b3177eaf63c5d9dcdf7f6c61168b590f2c2f792cd07ef1a7a073d70b9e25470f
MD5 a68046fb8cb8a68bc9c3c248348aec0f
BLAKE2b-256 a1c63ee4d57e16bf9d06998dd6995b31b6e5d81273d035a299db574febec62cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.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.3.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b465be7d1a3e8ef82d09d4d3e59bd86e096e492fa9e4bfe8eee728388bc0e5f3
MD5 8760901d083c948bc0978be813f95d7c
BLAKE2b-256 f1588b9f2a71d4ab757f9be333bdf93a93143e9ff2db70883a9b0e0305888928

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.3.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/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.3.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 9069942a59ab9a0810c3345e765f93c5b38ec36dd95cd9919a5a259ef2c1c99c
MD5 792961859d1b789177862ed3174cdd22
BLAKE2b-256 9762eaa96e9fe2da13dbfe7de1b4e0b9f26594cbef424d44821d32479397adb4

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