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

This version

1.0.2

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

Uploaded Source

Built Distributions

pikepdf-1.0.2-cp37-cp37m-win_amd64.whl (905.5 kB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-1.0.2-cp37-cp37m-win32.whl (772.7 kB view details)

Uploaded CPython 3.7m Windows x86

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-1.0.2-cp36-cp36m-win_amd64.whl (905.4 kB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-1.0.2-cp36-cp36m-win32.whl (772.6 kB view details)

Uploaded CPython 3.6m Windows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-1.0.2-cp35-cp35m-win_amd64.whl (905.4 kB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-1.0.2-cp35-cp35m-win32.whl (772.6 kB view details)

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

pikepdf-1.0.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-1.0.2.tar.gz.

File metadata

  • Download URL: pikepdf-1.0.2.tar.gz
  • Upload date:
  • Size: 2.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.0

File hashes

Hashes for pikepdf-1.0.2.tar.gz
Algorithm Hash digest
SHA256 cdd011e996aafb7ffac26722ae485586111f4bd062dbf25624bf3b42bec94242
MD5 45466c1db3533dd3f29ffa2a165691ae
BLAKE2b-256 46ee4149f0e507f224197e87c19e899d18a5a0d0ab54ac19ce149a22aaf83235

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 905.5 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-1.0.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d32635c4b36f759e75e4656cc977bb225760c118d8246c5bfacfea70cf27f555
MD5 ecf5b5e108abc70041679a5f75614f32
BLAKE2b-256 0a491e9b5a827e1b9de2b7d79e7000d43868a9984770af251bcd68d5b1d21f10

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.2-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 772.7 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-1.0.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 cacc1928aa9325498e15010ae7fdd5ddd2c0fe25df7b5ff9344b04436cb77f2a
MD5 ccc45bdddc7131a09466737d31c74562
BLAKE2b-256 7eb34dd697b44bded3b46b2d7eaf9489ca353e139ed916e85a918834f43f7c68

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.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-1.0.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ed98c41ad7ec1149d57bca6abcd665225133c59033163e83cf375bab4bd4165d
MD5 4fbad0ebc8970d6a2f086ce53d5751bd
BLAKE2b-256 4ed44c0d2d11c0348e2599ada91f9727869ba5843831b0167c27a8840934cfc9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.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.0

File hashes

Hashes for pikepdf-1.0.2-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 f0b9c0567e9d0c82c5f0079904668840f232e060406bba7d8a7b5eebadeaf575
MD5 71374cf5f73b0aebf741b1000f549081
BLAKE2b-256 156a049855bdce0ac8028f59f75725471974165e7d0e6540e6f97d7caa97f54f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 905.4 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-1.0.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 c9b455570b2949ec2531e8415cfe30ab2d96fac5763fcabd39e01d79fc3f85d6
MD5 26ee9965f82d5a84751b1a3644b01093
BLAKE2b-256 280d3b2e0b0d2c16a24745f7ee00ae0e31ef3d2a8f0d0cfd1929527b39d8f45d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.2-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 772.6 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-1.0.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 255b9a734c03dabe755fc8024f90049909fcbe7bb21d4f00598b46bb93e3d1c2
MD5 14ecf2b0293dba7d8e829af2efddc7c5
BLAKE2b-256 4dc2438d65b407c9d1fb1703d5a5ebbaac8201406ce1b171d9e2d8702de9028f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.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-1.0.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1234faf01b8f9c9bf9a59d9517f3f82c5664185fddcf254a501db9e758acd8b9
MD5 62c1df3bbe000c5f05827227294e5e85
BLAKE2b-256 f7713e994748a1416db61323c89336978a45f1a3b03ccad1cecbcc00f2af33a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.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.0

File hashes

Hashes for pikepdf-1.0.2-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 00b1175e1c6d298d658bf85c667ebaf1dfbf0e32ec16ee01f14ce8c204a8ada2
MD5 1a8bf751db39b0a7769be6232c4d6083
BLAKE2b-256 3128674d30392ff1dafc7147bfc0cb0483385b32d6ef6186bb21e289942dda72

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.2-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 905.4 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-1.0.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 987fba7d62039ca8c48088dcb3148883c9592e261d4866fc4fd8c51ca6c804d6
MD5 73936c050cd8277df3a5d6e7b6734b64
BLAKE2b-256 6181caf0daaf79e830edf7353d4e552e414ae336a7698b40bf5a4ebac771698e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.2-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 772.6 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-1.0.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 e7fb9b6523c384ecb1b04cef3827aee0de7cd2f3c60f8287573c464c6a42a6d4
MD5 400670f6670f10ac58f90d0777dad3dd
BLAKE2b-256 26accb7cb87c2bc56f783fd11c8701a6b7e50756d771d3c148337ba31c46c7ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.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-1.0.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e003e6a0537ad4b02247e2ae83c08e80fbd667e486027a1129ee354b3e271baf
MD5 58f0ebe919201b7e3477bfe9a5914aa9
BLAKE2b-256 f55cba106a1df05666c08a1306934ded94e237541fc9c800d4e9e94e91c4fe6b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.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.0

File hashes

Hashes for pikepdf-1.0.2-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 96bb6bf185b491d20c290f0baecb17db2f7adc218e90ac359d09ecf6a48c4c1f
MD5 69b1bcc7a8bb3973b4103be6f20185d4
BLAKE2b-256 5766864f4eb27a93b4d298e4f21a5b80d9b1c657e88916a5944ecaa7b02cf742

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