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 speed C++ 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 ✔ ✘ ✘
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

0.3.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pikepdf-0.3.4.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

pikepdf-0.3.4-cp37-cp37m-win_amd64.whl (865.2 kB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-0.3.4-cp37-cp37m-manylinux1_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.7m

pikepdf-0.3.4-cp37-cp37m-macosx_10_6_intel.whl (995.8 kB view details)

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-0.3.4-cp36-cp36m-win_amd64.whl (865.2 kB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-0.3.4-cp36-cp36m-manylinux1_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.6m

pikepdf-0.3.4-cp36-cp36m-macosx_10_6_intel.whl (995.5 kB view details)

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-0.3.4-cp35-cp35m-win_amd64.whl (865.2 kB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-0.3.4-cp35-cp35m-manylinux1_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.5m

pikepdf-0.3.4-cp35-cp35m-macosx_10_6_intel.whl (995.5 kB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

File details

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

File metadata

  • Download URL: pikepdf-0.3.4.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.4.tar.gz
Algorithm Hash digest
SHA256 d7a5288f3361ae588282400285278da25294f18db1bbaa94165fc318090dff90
MD5 6b646cfe6be0300539e4cc12ef791ea1
BLAKE2b-256 0e28e7461cbf3eaef36d8f4d6677176c81904f9829d57eda30b8702b31b0698e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.4-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 865.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.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for pikepdf-0.3.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d2089ccbbf3de6c951ca95d8bc7b77dda878d3910f361410f191d7f763eef452
MD5 41c0a73dfeda0b62eed18985bcf30693
BLAKE2b-256 644592c28294c7cd2509f55e271e96a422a7274f0f3b87d0f4abb4e58b1a43ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.4-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for pikepdf-0.3.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 057036e5902bbdc9d4e069e7a6233f3c47574e00db29b3737bd4e6ca28b54a3a
MD5 5bb653c4d278c309db93825be17b3da4
BLAKE2b-256 e7ae9f311ccb612f99cb78e64c6a04dcbbc4270f0fead768505355ba8d92e6f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.4-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 995.8 kB
  • 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.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.4-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 2b6ac961cd736262e63f837508c72021e7bafc894f5b06c3eb13ff07e5f5ab7c
MD5 8ef10fa3f1dbb006b394a9f62a783dc6
BLAKE2b-256 23afaf7cda083c7a6788ede602529b9cdfa6db773a4006d115149f9a33020260

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.4-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 865.2 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.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for pikepdf-0.3.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9139f0c805ed2ad3994f52ec414b65144f4b948345ecc5b6647efb0b19c89774
MD5 24ef6f71321f994e539f72d5ca3c4937
BLAKE2b-256 08915e9c91e72554fd51b43907ba1bd067f309b11af33a08d0ff77007b1300b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.4-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for pikepdf-0.3.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 134bffbcae6924ad3a4a8df7dd394e6990739950b9ca844e2dbd0eeb44b80615
MD5 386472fb8d012b209c329d205be6804e
BLAKE2b-256 8d7a6ea0b7f1244e17b8b31e127d71b409f85d8dfd99c188adfcd2f16df5dfb0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.4-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 995.5 kB
  • 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.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.4-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 870ec328fee583a1c80d4f8eab28599c481c5634f9049bd7f5551ceb10c7ec95
MD5 ef498c4936769065fbb71045c9c3e5b3
BLAKE2b-256 3a525cd6173fa77ae42700dd1fcdd9fb13b3dec475604844abb88d996804b663

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.4-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 865.2 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.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.4

File hashes

Hashes for pikepdf-0.3.4-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 c426f1dba74ac458b3307e7efe08fefaf9a48f5fcc96e7c8d23685065edf9899
MD5 5fa5b7f61dc3cd1d6db23543ae300cfc
BLAKE2b-256 dbe75767b06eb42643598df2cb3b8d3c044b8fa784b929c87c73d9037071589e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.4-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for pikepdf-0.3.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8e1c779969cd6dd6bde26ab586221d8d160791fb234f0291decaf73f2ac89170
MD5 4129c184860f71450636d5ac75c63fd1
BLAKE2b-256 ea116cbceba7569aeecb3d2193de0f12257b946554f206ea1f74dd4bd844933f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.4-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 995.5 kB
  • 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.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.4-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 fd2ffd475cf9bbd097ba7a34452001931c749a8fab2cbbdd8eef2bf2d6b00796
MD5 8ca4339ec79ee263e1900b62243a17a9
BLAKE2b-256 639c6c3495338debd4b8edaa27171a1a9005d33079f52a3f7a99ec1146ba1157

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