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

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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7m Windows x86-64

pikepdf-1.4.0-cp37-cp37m-win32.whl (846.2 kB view details)

Uploaded CPython 3.7m Windows x86

pikepdf-1.4.0-cp37-cp37m-manylinux1_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

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

Uploaded CPython 3.6m Windows x86-64

pikepdf-1.4.0-cp36-cp36m-win32.whl (846.2 kB view details)

Uploaded CPython 3.6m Windows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

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

Uploaded CPython 3.5m Windows x86-64

pikepdf-1.4.0-cp35-cp35m-win32.whl (846.2 kB view details)

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

pikepdf-1.4.0-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.4.0.tar.gz.

File metadata

  • Download URL: pikepdf-1.4.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.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.4.0.tar.gz
Algorithm Hash digest
SHA256 8d8655f55649e1b10833e5087d0a586cbc36ab8d137d8a04ad2594afd1df28c1
MD5 a00575789c1f8c2461db2e78517dcb17
BLAKE2b-256 b0dab0fec9f04ef731c7038838cd02e8a7796c141f954c8fbedcc16cc79de066

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.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.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.4.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 ab48a454ae924263b5481eda0d6f3bc29e00bcf2c1eaa5edd329210ae6a3dd83
MD5 bcfb660196ca4497105beb8b58419298
BLAKE2b-256 f83c19a0c7346e511bd4f8223f0cd1256a14b4940dd597f646a6dbf51769b6cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 846.2 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.4.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 bf601675a8191a94866ca5535d3d6848a55d5e2a8858bc0548c07a8a956e241a
MD5 e764cabac6239144d4888ab901699511
BLAKE2b-256 cf77733fa906a1f80968e087c0a7403e815d3307b64454bc7f37e50432a6fba5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 9.9 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.4.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0845f3d9ae35963f95322f4a532281d747eea042e2432b438a033e655e223882
MD5 8c33195fd2f0e5545b8a54ea70faa2f4
BLAKE2b-256 77aa3d393cfdcdb738144de5e3c88f20b2a20b488010c8bd36a985fa2db47057

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.0-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.4.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 50e7a0864c9d7e8c75513b02eea0e05a76b7b4a64c6bd88d2e94da58809b8402
MD5 8706996bbf8f2fdcf1b4e01070a46396
BLAKE2b-256 7c5441239c1e37f2a56f3e48399c51f637636d2f95395d7ffeee941d6bb985e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.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.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.4.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 30156ca27402c1934daef1d7a6892739fb57fa8a10bfdc97d4ea4e0fcd67c6d6
MD5 db5b26e9b1f13a279a26adb10afd7f27
BLAKE2b-256 dd86fd5387cd19275698b7aeaa28e683928b68db4f494bc3b3e9de76c30796c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 846.2 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.4.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 36c23c654fa49a0905d14a0d51fe8ab9e45bad9b88dda56cdba35eec2c7c59d1
MD5 31a1f8b47b88e67b4555f97c20322737
BLAKE2b-256 1ddf39a755e4054bd3c63466a315941d8da65295fbf51f433d7b9f28555b5d43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.0-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.4.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 02259bc4c5948528e0047cfacdd39b2004e38d626ef45739f066f565caed1437
MD5 392886d74a9eae10aa6b88603874f2c4
BLAKE2b-256 b04a7b64f7b5977690b8cb9c549272df00ca7b120dcfa9778e9376164f09ccc4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.0-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.4.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 b331e436803f6e2652e2207d412cecdbe213ce1908e7a071087ea01d820668e0
MD5 e41168c4997512c2f2b1d9ac0e05611b
BLAKE2b-256 e11c3caa7f31e3aabf326b7582fb5687ffd189e67f19f4a2114a45b311110472

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.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.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.4.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 44b0ddbf5c06b0f4cce9a877a6285355a2bc849b2031274b9da4d21b92a193ab
MD5 ab1dff2f1e17646ebbfb81b3ff1551f1
BLAKE2b-256 1b1e9f6b8493e337c3722beae1913629a0e8ef0486e3a723706e80c4e9b01aec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 846.2 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.4.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 ac4ed787c44391605e2811273f1dc0a7ec59bd9430a4d005b475aed83e0eb8d7
MD5 4e8579861d89cfcd31701439da0b7e62
BLAKE2b-256 4016cee212c475720c08c63679afb4e3227152bfa22c0e9b50c392a7005ca5ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.0-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.4.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 46fbf3145e55b6c4dd74596b004c1a1b0c8f03f7ba0c90189aa58ba8f7ca2c9e
MD5 ddb6f809bb68193baaa651eb1603c418
BLAKE2b-256 376ef089bb355fb0400562933a713374b3800fe1e935437989e8fcf7fd529bc8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.4.0-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.4.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 9ce7f0c74fe7d549191660478faa8fd80c7268b5a6167c42efd50badaffc81ca
MD5 d62bcd1c391e7b81b8c91011ab73a124
BLAKE2b-256 395944212695f9e9f74cd79aaf89fc6628ef09ac39547da38186e73b371cac3e

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