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

Uploaded Source

Built Distributions

pikepdf-1.0.0-cp37-cp37m-win_amd64.whl (905.2 kB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-1.0.0-cp37-cp37m-win32.whl (772.4 kB view details)

Uploaded CPython 3.7m Windows x86

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-1.0.0-cp36-cp36m-win_amd64.whl (905.1 kB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-1.0.0-cp36-cp36m-win32.whl (772.3 kB view details)

Uploaded CPython 3.6m Windows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-1.0.0-cp35-cp35m-win_amd64.whl (905.1 kB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-1.0.0-cp35-cp35m-win32.whl (772.3 kB view details)

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

pikepdf-1.0.0-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.0.tar.gz.

File metadata

  • Download URL: pikepdf-1.0.0.tar.gz
  • Upload date:
  • Size: 1.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.0.tar.gz
Algorithm Hash digest
SHA256 c392a9ed7cdecc0676a114583f095737ba9fe44c9fd1bb8fd04765ed95b1459a
MD5 fd5353d696aef4060de8099973c19b22
BLAKE2b-256 8e8a2e8bd975b60a9418345ec7843460b099ee8c613d35d1378e168bbb9c2c3d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 905.2 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.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d7aa4eccbf2f76a9fb9c16863cf091410bb67bd7c23cc515217ed06f0869f5e6
MD5 8a7e302c98c8fb9a6440872bc19df3c6
BLAKE2b-256 51cdfc727ebe0e188ee62337806cc5f8ba298baf1a57b4e323d87c45a1192ce1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 772.4 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.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 b110c2f3442935bcd00b4bc26227d95d7f9d2b678dee8ef6de195096a7345fef
MD5 2cc34a2bdbd853ba2cba03e0d18f2bfe
BLAKE2b-256 3c892098404f1853f5f55ac6e774e3124cb495e0fd26c44e405a6877a31454c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-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.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ec75509054b8acfa21396717976896a4ba4b5778ecc7319095b2e246bb5dccb9
MD5 7645d70546da8d14e4c5c2b48a0f8254
BLAKE2b-256 a933def0ee18bd96ff9523a58918d8cd2b00e85fb36fce64e20c773e09f2343a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-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.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 74cc1d97b7221c105fac09e5dbc255e28a16866573e2b6ab725516261025dd6e
MD5 34c72c8e6a56dfdde75e3135a93011d1
BLAKE2b-256 910c03ea56ecc084ae049285d2562b68c37e4aa292d4b22de64790ead99b0491

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 905.1 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.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 c557b10ab1ae3b4aaa67cf7f585ed6e14aa263e66554e669426f7a94ec71b6f2
MD5 90e3f5eecbedc6a7a7057a5c3ad9d016
BLAKE2b-256 9faa4c87ba313f1aceb0391dac62c399c242c62250b8e600e0b6cf74650e7816

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 772.3 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.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 aff471c75f2c340f3d17e7d3983405ef9591ffea16bc94b23d23148d6eae9e2f
MD5 14469b6d39e808ccf9abc88392a0b2e3
BLAKE2b-256 d5a98e031c7bc2730164a3ba9a4241524003ba38ec67ee20a81d335899de2415

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-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.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0b30ae312ae9f175d3fc7b35bba8e080f218ffd9dd35a43ea7347abdbefb7562
MD5 48b084fcb86499c5f15b1889fac6d476
BLAKE2b-256 8bf885bbf8f13e55bc1c9be32a31b819ecfd3c8c9f44c63e0e0b34f897808062

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-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.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 87ab08dd70e73e1f59c85c3108e5d30859bef6fcd7f523618553b1bd1c428025
MD5 ec940c4e26689da1fea07bbaf81b0e20
BLAKE2b-256 e1bb393fb97281fc0b14259a724fb5b41865e52f0b84fa9c071c84165c7010b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 905.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.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.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 648c1019e09281018476259ed4eef4703ac8a8fafb451ddf982221c60584ba80
MD5 b2eecb3a7d16ef3b19b8579a14716473
BLAKE2b-256 f7180e5f1d37b4f200d7a1a4d2aa1fb0b874c6cbe78daf3e9c05b60e6c1cb506

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 772.3 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.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 4b6c4a7272d990f7f056799070a2b84819cd7c8e9b455b95b516b577666d348c
MD5 aa816d3e18df0f26d7bb1e4c6e69b20e
BLAKE2b-256 ba1e3e9652ce4fa394de90c5d01327d8978e483f7284db7d518cd215d1210b35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-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.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c82603221507176dddbd0ca5afeac7245a31a2a6e3cafba4780227d1cf1cd159
MD5 a370001fb106f742aa5bc9ca5b85d9b9
BLAKE2b-256 cba1f942c3113b5607e4e923c380304553a283dbe17bef7fbdd2556d0353ecad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.0-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.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 e93ae3e06225e629085ca372503f748379cffa1eaf8d437c1f5ecd92e5dc4c6a
MD5 6ae6267914bc81510ef978745f81551d
BLAKE2b-256 16760ad4d112c08f8b2b5e9530a42c533a21e2c4e5376e09a53200957da4e940

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