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

Uploaded Source

Built Distributions

pikepdf-1.6.4-cp37-cp37m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-1.6.4-cp37-cp37m-win32.whl (907.5 kB view details)

Uploaded CPython 3.7m Windows x86

pikepdf-1.6.4-cp37-cp37m-manylinux1_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.7m

pikepdf-1.6.4-cp37-cp37m-macosx_10_6_intel.whl (1.4 MB view details)

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-1.6.4-cp36-cp36m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-1.6.4-cp36-cp36m-win32.whl (907.3 kB view details)

Uploaded CPython 3.6m Windows x86

pikepdf-1.6.4-cp36-cp36m-manylinux1_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.6m

pikepdf-1.6.4-cp36-cp36m-macosx_10_6_intel.whl (1.4 MB view details)

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-1.6.4-cp35-cp35m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-1.6.4-cp35-cp35m-win32.whl (907.4 kB view details)

Uploaded CPython 3.5m Windows x86

pikepdf-1.6.4-cp35-cp35m-manylinux1_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.5m

pikepdf-1.6.4-cp35-cp35m-macosx_10_6_intel.whl (1.4 MB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

File details

Details for the file pikepdf-1.6.4.tar.gz.

File metadata

  • Download URL: pikepdf-1.6.4.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2

File hashes

Hashes for pikepdf-1.6.4.tar.gz
Algorithm Hash digest
SHA256 50ad2f2903db21b9105c1092ef947b456134a77355b4386535492dc28a6a4e52
MD5 e1aabe5f95fc53f43b7b3d740544bf83
BLAKE2b-256 4314934f82ef48e0c06feef4e8561a645f9c755e0cc50d92f846c1f491456714

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.4-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 575dbd6f55344bda742aa9e81cfcc634cb2d69f95c9766e52f723b1088fe6825
MD5 3bc5f0871c7e21a1ef693cd5a2690f60
BLAKE2b-256 5b1e82607f1c2efd00520ae68c239bd0d11f78bd1c67dd302cb496fe2bced8a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.4-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 907.5 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.4-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 9639dbf047884f3d9710940d828e8f64cbc3d796a12b657f41814b12e9a01f7f
MD5 40644d930611a7fce1b0b71b08ef8e1b
BLAKE2b-256 34c910ed7ca6b2b3b9a09b8320ce2b7997c67cb94e8d7d92234e74fdf8fe1236

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 659fbb9c586645a03d32e83c6c310b4f49a55da59dca373873e3104c3231ed45
MD5 f83bb6c1c48696e3fc62340adf5ca367
BLAKE2b-256 82272177a00b839886cce5817f4444712f8bfa7028ce6f93e788e17929de4477

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.4-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.7m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2

File hashes

Hashes for pikepdf-1.6.4-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 a407b12edf4508a071189f3d5d292df7239d6ab80db7433a0ea8d8766d5db35b
MD5 4e05d2991a0b15586f285b870e65de26
BLAKE2b-256 0f563c6922f3246db5b1daadcd7c4f0102cc3404b28f283dfc5268ab367e2bc3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.4-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for pikepdf-1.6.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 0ec061be444812f6c63867a8fa545c12be40138a46e2c4fd03daeec55c25439f
MD5 4817b7275f905fbedd980997b7900aeb
BLAKE2b-256 4323e92d6101992947afef01137bc41e19a4c57b2457120a8d553b65e566e2c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.4-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 907.3 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for pikepdf-1.6.4-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 b6b4d9c7c7e133ccc9183f30c70d83553af579afa0136d18b96c8be0d4b37b25
MD5 4a15bdf10e8c78195574908b4a8ece23
BLAKE2b-256 938efa04c5143ef0c2b5fffe68856c1ff5860ea05d1e4d39b08ae7daac5a17d9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2acd55d4512425cbb21f163975c309fa9821faff9dc96b052186987398362337
MD5 89c9fbc9a914e2c2c987da119a126240
BLAKE2b-256 b86fd1042063210763bc865a5af2135249869251eb8b7dc71ee357120101be98

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.4-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.6m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2

File hashes

Hashes for pikepdf-1.6.4-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 a8b11dc4a417ff184e6e12ab2ec54ad8078a6e878c455bdc6b28548c04327b26
MD5 5c614cf61c1aad5a6f00b01ac1b93402
BLAKE2b-256 1e4e715d87f1db14cec7e7829151b208e171eb8ff212747e58f078a4040280f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.4-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.4

File hashes

Hashes for pikepdf-1.6.4-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 6e24d40f6b3d90696e4f5d0fa4e7789c04fc40e081eb1703e6d9c5be7613a991
MD5 e1f6df939dacb2125f5eb081c55cbec4
BLAKE2b-256 a559bfd5c2776c3dc49d2ae8f48d8a7a78ef524c5438db8fa3023b15136c527b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.4-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 907.4 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.4

File hashes

Hashes for pikepdf-1.6.4-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 ce1c5004950aaaadc04313ea29ffc44f1c64577183a5927919ca233cc87a803c
MD5 ae3d73107dba748dff258cfc0e045f55
BLAKE2b-256 ca65af73148cee2866c28adcd5b3c51b30c0764641e9ec41ee979180420b9255

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f716ea08d0b7f95166ca92d0272fdc6b83474764ceffdd75ada5cf218995a7ab
MD5 c86bc8350c4de44282c52be1b2dacadc
BLAKE2b-256 63bff0399b69c535e4b523348a135515a87811c05a569b027a3323ad7bb890f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.4-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.5m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2

File hashes

Hashes for pikepdf-1.6.4-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 9fa51b48a0b2abc2a9f00ad3e0a2553f9d36507c19b004b0718953b12971213b
MD5 bd5e054aa4a9970481dba54da0e3a621
BLAKE2b-256 9761bcc0f6334829c4efbd9e2ff09cb8b4ec03c528e030d5fd71c97e4c595bdc

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