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

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

Uploaded Source

Built Distributions

pikepdf-1.0.3-cp37-cp37m-win_amd64.whl (905.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m Windows x86

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-1.0.3-cp36-cp36m-win_amd64.whl (905.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m Windows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-1.0.3-cp35-cp35m-win_amd64.whl (905.3 kB view details)

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

pikepdf-1.0.3-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.3.tar.gz.

File metadata

  • Download URL: pikepdf-1.0.3.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.29.0 CPython/3.7.0

File hashes

Hashes for pikepdf-1.0.3.tar.gz
Algorithm Hash digest
SHA256 1ab4024748b1ae7ef24644888b829295463a87d538c2f06c1bf01273b23a0521
MD5 edcc6d9f9032c6c6c673b0bd7a40b1f6
BLAKE2b-256 8752614880b3778021f736a59000974463e3bfaf22a2d748eb287f2504b6c02f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 905.3 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.29.0 CPython/3.7.0

File hashes

Hashes for pikepdf-1.0.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 4b3dee3fbdd08be8c155e7def481f53d136f70300e4cb6f395fdae5ea78440c8
MD5 4e020ad0a308015adebeb4406408d83b
BLAKE2b-256 abe62b1801904c838a73afcc90e8bd4e7a7e01626f9ba1af81c9f842d452f5fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-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.29.0 CPython/3.7.0

File hashes

Hashes for pikepdf-1.0.3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 89be317627e610027c5591fc9a143f7f95f934420d89276ec0f67bebca05fd95
MD5 24eee1ae6bb257aade61f2a3b1e29deb
BLAKE2b-256 39d15af306e29be4b0f547e5bedb83e0574e2079eb77f1116cc521c33ee3eefd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-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.29.0 CPython/3.6.3

File hashes

Hashes for pikepdf-1.0.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 617bcc6c1ae41eff8045fb2e62f1d8ecd61180994de4f3fc53bdfc02a0468ec5
MD5 b0e30ada964906f8ad9a77ec22dfee67
BLAKE2b-256 de8fc3c1b421d585ec3128bb43b1e206bb6a04f8a9d36945cebd9331169cd09a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-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.29.0 CPython/3.7.0

File hashes

Hashes for pikepdf-1.0.3-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 afdc977a5642b6500271908ff486e374dbf5406c1e58ef61f544e733af03d90d
MD5 cb86ebe36508bc52875aae45a6d3451f
BLAKE2b-256 4004733f2815ad94f17f790d409406bd04e6e79adf84b17c8a8e14ca8415c138

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 905.3 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.29.0 CPython/3.6.6

File hashes

Hashes for pikepdf-1.0.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 421aebfe83098c272be90c898d12903f01fd3aa645146b765e42efcd6c6723e6
MD5 d4da127f35f994f995873d2b973a663c
BLAKE2b-256 869ac97e0972bcb2f643c8f1becb3dfa3c64228fa30138f6bdae61431dc2358c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-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.29.0 CPython/3.6.6

File hashes

Hashes for pikepdf-1.0.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 a07728d3196763b9fa984428f95c92d1be14d50700f053a5aa1bcd848850285f
MD5 8afab2db3257c54ec292d4ca7e3ef327
BLAKE2b-256 ad4a01dce161234bb2b47625f156315f9c28a29960254289df4ff959af602848

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-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.29.0 CPython/3.6.3

File hashes

Hashes for pikepdf-1.0.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b9a2e3f89a202bcda1419b5ca4d6119fd89acbedca75b5d4e668bddc88636699
MD5 bb74f8189fb31272e72852312de32c62
BLAKE2b-256 ee5b75ee810ae96ef8f86b0143fb5383826270bbe2732ecc5e484cc658858854

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-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.29.0 CPython/3.7.0

File hashes

Hashes for pikepdf-1.0.3-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 aab3a4d22beb53c81b0c996cf8726aef1382e875d3b8c9046518255c61eaa0dc
MD5 7495a72c5ab763ce622a793702c055fb
BLAKE2b-256 33a7aa4b0c5ef458b2c5ab705c9b059908b0dcc71c316dafa9c834a4bdc50f8b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 905.3 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.29.0 CPython/3.5.4

File hashes

Hashes for pikepdf-1.0.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 979dd1867ff3e2038174d7905df141dc3762d95908cb5cac671140bcd8bd3837
MD5 48ac82e6a84b2102617f4b18aa09f06c
BLAKE2b-256 e01e3227021e9d08f7bc739348fc85048e01e6b9b934aed313f9e448a7b9d60a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-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.29.0 CPython/3.5.4

File hashes

Hashes for pikepdf-1.0.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 bc249b939a181c1b4cd1e5167ebedbd6d2a0b9435c8abf73c9f043a8142a77e6
MD5 8b97b936f95275df47150889e7fcee88
BLAKE2b-256 e8d7438df3d082671b44f54c3f7b690476787033f2f210e185ad571fecf16deb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-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.29.0 CPython/3.6.3

File hashes

Hashes for pikepdf-1.0.3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4554dc43a421d1266596fd1ea5e96e92d5148f40f6942be0b2f96cf719c80731
MD5 28440d30c9e75a7f2b270c427f261771
BLAKE2b-256 ad196cabb286db4f3fa1865d23b62fce8090c419e1e44a924ada12c268091536

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.0.3-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.29.0 CPython/3.7.0

File hashes

Hashes for pikepdf-1.0.3-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 af8365edda8162935fdda26320de9f35c8db344c67eb05a77ea30633b607bd38
MD5 b8edea6dd20c7aa0e435cfcc94b77d66
BLAKE2b-256 7a84014f98790264180efa8aa34a18a7aefe6cb2ed0e71f98d614ddb4a492a73

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