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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7m Windows x86-64

pikepdf-1.6.2-cp37-cp37m-win32.whl (861.6 kB view details)

Uploaded CPython 3.7m Windows x86

pikepdf-1.6.2-cp37-cp37m-manylinux1_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

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

Uploaded CPython 3.6m Windows x86-64

pikepdf-1.6.2-cp36-cp36m-win32.whl (861.4 kB view details)

Uploaded CPython 3.6m Windows x86

pikepdf-1.6.2-cp36-cp36m-manylinux1_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

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

Uploaded CPython 3.5m Windows x86-64

pikepdf-1.6.2-cp35-cp35m-win32.whl (861.6 kB view details)

Uploaded CPython 3.5m Windows x86

pikepdf-1.6.2-cp35-cp35m-manylinux1_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.5m

pikepdf-1.6.2-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.2.tar.gz.

File metadata

  • Download URL: pikepdf-1.6.2.tar.gz
  • Upload date:
  • Size: 1.7 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.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.2

File hashes

Hashes for pikepdf-1.6.2.tar.gz
Algorithm Hash digest
SHA256 3f0d0144c49a64e48f238d2fde97156e550c700750d064567444826c7f292bf4
MD5 251db8b50c2874d24d83bc21030dcf59
BLAKE2b-256 d233281d4bc2c83d44e39541b5e724cea75d5c64664c78386f64fe60dbee548b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-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.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 9836913272ed18be7f487b1059696507c422fee5a892ff5dcded4e42c82e073c
MD5 5b5647b80b1f720ea28a4f6d6fdf922b
BLAKE2b-256 57f33eaa2525401290e6a92df55fd5bb10393af1f707bbb401531aee6e1f9251

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 861.6 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.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 7e8830132b34a173c5ae4959abc1d526833fe2c6840fee114d218013c58b928f
MD5 2b7870f37337381b6106a7dbeb07bdd0
BLAKE2b-256 d1adc5fdf44b25053a2790ebd0d33c4be32c12d0cb4f1a5d4989dd15b1a1d2d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.6 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.35.0 CPython/3.6.3

File hashes

Hashes for pikepdf-1.6.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 11c09411d466c904d8d6281ba46010c20186aa202d093b156e28848fbb84445f
MD5 384ecb83cdf6d5ece3acde8f62964a0f
BLAKE2b-256 819ceee860f42f33fdf3e1c203699c5e4b3ee06757e78a4a51be0bcbad7ec2a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-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.13.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.2-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 fef89871c979cd482d3e208a22809c64292c803b3e9ce93173fe23bc7bc78b16
MD5 511647b73f03f1f05c452ce256d77cdc
BLAKE2b-256 06eb8fde341b35f170c7b8c3143910a561f7f3ea84d028113451d5758eb5c088

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-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.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for pikepdf-1.6.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 404c199c5178a90333c8db71b40e94b3647f88db0c51682ae89d5c6e70299b12
MD5 21d75896930a07d172f9a0fd3ba333ab
BLAKE2b-256 cbb0510274ef4911123092e33d93ba0526619d0d188f6ae371f3c8daf8bebe97

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 861.4 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.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for pikepdf-1.6.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 c13c817ae3fdccdf66939d31255dada769c0aec64c2b7ceaf76189a539d4d9bf
MD5 1a009a7af26563227ee326665a3a43ae
BLAKE2b-256 17483a216c59a3e150c0a0cd94866bc6eb17e40dc9321cc7574340d64448b0d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.5 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.35.0 CPython/3.6.3

File hashes

Hashes for pikepdf-1.6.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ee75bede61070e07816df84b1a4b692ff94f20785a449ae531e6cfd387c33af1
MD5 b4e5cc559921b4f8aba1e1ed79ace72f
BLAKE2b-256 6d0505af46dc0a94a9aea9d4fdacebb261213f639f0382b962d742ad541b1475

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-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.13.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.2-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 e02c326c80969424109f5bea068137687ed7746bb605ed8ca0e769bd5c86d625
MD5 1a3ad5ec00288798fe07c96a6d9f724e
BLAKE2b-256 66c2621fac180f77d4122583999d1df08a4fef573115d150b308cad1e401403a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-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.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.4

File hashes

Hashes for pikepdf-1.6.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 bb88151c07d845cd9c1be33c4327379560630583be0e9839d9ae8f44e16b98e9
MD5 d4f5478ce09c635a9d646a9903f69434
BLAKE2b-256 9aff796a9fbebbcc995667f428083685dd5204337845438554a197ad012f0473

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 861.6 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.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.4

File hashes

Hashes for pikepdf-1.6.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 e268a190c1875013eed012bf1361a346ee0c3b8618ca3cc0ade1f2b3c9f91047
MD5 2fbc8fc5046212abae2c2cc751713c8f
BLAKE2b-256 f44075c3a4dbb6a910282c3dce932f38410d962834d5f12cf666b3b630439616

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.6 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.35.0 CPython/3.6.3

File hashes

Hashes for pikepdf-1.6.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9520be4a76c2d4e63069ba64d6f85520c834a298d4bdbb0547649433af6b03af
MD5 a5def2b11fad268f89dcf821216233aa
BLAKE2b-256 e7cf8c7b9f217c35d23562db7e34ce9a978229d7e3291d511023b153aa6bcc6c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.2-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.13.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.2-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 31f19f4d5ffb80d9b3bf3023245d8f564c572d17d140ade8ded98b3f51f4948c
MD5 7b5d52a160d179c5f60ed6595abe7dbd
BLAKE2b-256 996977f7a165a09099d2fc93f2fe15bff267bc5098c9d050cdc027e48ce55cc5

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