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
with pikepdf.open('input.pdf') as 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.

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
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 ~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

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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7m Windows x86-64

pikepdf-1.5.0.post0-cp37-cp37m-win32.whl (848.9 kB view details)

Uploaded CPython 3.7m Windows x86

pikepdf-1.5.0.post0-cp37-cp37m-manylinux1_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.7m

pikepdf-1.5.0.post0-cp37-cp37m-macosx_10_6_intel.whl (1.3 MB view details)

Uploaded CPython 3.7m macOS 10.6+ intel

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

Uploaded CPython 3.6m Windows x86-64

pikepdf-1.5.0.post0-cp36-cp36m-win32.whl (849.1 kB view details)

Uploaded CPython 3.6m Windows x86

pikepdf-1.5.0.post0-cp36-cp36m-manylinux1_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.6m

pikepdf-1.5.0.post0-cp36-cp36m-macosx_10_6_intel.whl (1.3 MB view details)

Uploaded CPython 3.6m macOS 10.6+ intel

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

Uploaded CPython 3.5m Windows x86-64

pikepdf-1.5.0.post0-cp35-cp35m-win32.whl (849.1 kB view details)

Uploaded CPython 3.5m Windows x86

pikepdf-1.5.0.post0-cp35-cp35m-manylinux1_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.5m

pikepdf-1.5.0.post0-cp35-cp35m-macosx_10_6_intel.whl (1.3 MB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

File details

Details for the file pikepdf-1.5.0.post0.tar.gz.

File metadata

  • Download URL: pikepdf-1.5.0.post0.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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for pikepdf-1.5.0.post0.tar.gz
Algorithm Hash digest
SHA256 55d2dcbc8ed9c30d8f81add75b082b0fb89014fd8f2e0b8d464aef87f8f9d130
MD5 62803af30152cc6a1b889bf09f0c2d8e
BLAKE2b-256 d29455623d1e6813f8f2d36b48bb25066bdcb91ed7ba7d9b62a29d61b4ca3ff4

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pikepdf-1.5.0.post0-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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for pikepdf-1.5.0.post0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 2a2ef977d1ac5d165d800fb920710b8f874bd4f3627e5317e361856eaba41a72
MD5 4781edde095bcd69f056c0ad5abdf283
BLAKE2b-256 c474211d45d3c01fcaee23e91630c07ec2cfc760741106568186b8ab9e1f5a0d

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pikepdf-1.5.0.post0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 848.9 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for pikepdf-1.5.0.post0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 e90e5bf4f8ffca69041bd52e187274a614b86b9dce3044740f389f25dfbdf495
MD5 4c3c42044bf7b9f9183b0270b9f5dea6
BLAKE2b-256 88123cc87b1b2d016c32310c734586c8aeedfafaab1a8d90838bf696fc252e3b

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

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

File hashes

Hashes for pikepdf-1.5.0.post0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 03f0c36db406f3a79690ccb82ed4aa947205dcb15a466f9d93536ff8a79c73c9
MD5 1214416545795cb86c7e5c1bf1569006
BLAKE2b-256 28ffe0058a26e67c53cafed4b0ddadf9d4562eff4b782e7669358a70d943d0bf

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp37-cp37m-macosx_10_6_intel.whl.

File metadata

  • Download URL: pikepdf-1.5.0.post0-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.3 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for pikepdf-1.5.0.post0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 e38a1b7591d31f522421ccaf378c23ee37b9218f4c033ca9655a4878fccd2efd
MD5 89b161f0719d52dcd561f4fb8816b317
BLAKE2b-256 7134f2cb0ec999d100cfefaf3a8e12aa4e92c1a1e6342e8299240923e1453cb9

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pikepdf-1.5.0.post0-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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pikepdf-1.5.0.post0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d73b196b8975c3bc67729714e6f7bfdcbc43a991649c9027efecf2e46d6664f9
MD5 5db44b99fd124ba263dabb4286abccd9
BLAKE2b-256 d0781aa77e8b1e24161c3917ae7d39769403e53ae1ae6e4ecde76f7555b26db3

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp36-cp36m-win32.whl.

File metadata

  • Download URL: pikepdf-1.5.0.post0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 849.1 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pikepdf-1.5.0.post0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 d15d6dd7979f05f1fab679bbb589354b777fb38719bc51b34667531405c3ab6b
MD5 dbc09b7e4977fbb9cf10da4f611c7ec7
BLAKE2b-256 897e83bc3d11404f01a83919e2465e1fe76fb0ab0d96f0cc605a1053763553e9

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

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

File hashes

Hashes for pikepdf-1.5.0.post0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cc252586ac2b790bdaa331a36832d6c4ff62a9f9d35f2a10886c80efdb8962ec
MD5 e9c3186ee9a2eef57149cec3b3354dff
BLAKE2b-256 d1e2a810cd269b7516ebb11258e1dd1818c21db315235a168a0c96d3afdc0756

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp36-cp36m-macosx_10_6_intel.whl.

File metadata

  • Download URL: pikepdf-1.5.0.post0-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.3 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for pikepdf-1.5.0.post0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 7db4d5741a2f793c81dd307d72a19ee5ff8748699d203428ce1e2fbd35509774
MD5 636a584a79bbed5547fd467ba3b20191
BLAKE2b-256 05f0e711d20276dc672587f04edf7225ab6bdfd70bcb75bfa6c97d908a1ced18

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: pikepdf-1.5.0.post0-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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.4

File hashes

Hashes for pikepdf-1.5.0.post0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 6778488b61fd153553b4d9f63d5d71e50d181f46802ba47ecb33b5ef725bec76
MD5 f02b6bd840b628e6282618a2b21df6fe
BLAKE2b-256 4c6182f08735ff3aca1233962d97feff9798c08187a49aa90b1ee2ef4ac36424

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp35-cp35m-win32.whl.

File metadata

  • Download URL: pikepdf-1.5.0.post0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 849.1 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.4

File hashes

Hashes for pikepdf-1.5.0.post0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 63cc4adf2328cc1c6f638d13a46c01bd9b4af536f2c7ca3d645a2be95cbbb0e7
MD5 6370f79da08e4190d176c43c8d3d78f4
BLAKE2b-256 94222c48372200351f42517fd423c4d4feb7f5f7a86fb9caab6f7e6244e6bd7b

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

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

File hashes

Hashes for pikepdf-1.5.0.post0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1e238e4f2a13ffc0a38533e0266cae3c27088eb3d0d799515356c168a6fd74be
MD5 f1137e76e3eca691a1a9595e938e019e
BLAKE2b-256 dc47a635a36cbd8d1ea1a72f6579f39550965c935650437aba3018b3002203ac

See more details on using hashes here.

File details

Details for the file pikepdf-1.5.0.post0-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

  • Download URL: pikepdf-1.5.0.post0-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.3 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for pikepdf-1.5.0.post0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 dec5f7db5d67e6f4b4dffc12924cf4e0e6249a1465b4ddd2300fce1057ea72d2
MD5 0c1c4393ff15fb6db3f2249b46cc56a3
BLAKE2b-256 0bbe0eebad228a9f6a1371ce6bdb6f875aba0fbe577cd7b8b9534684d82466a3

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