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

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

Uploaded Source

Built Distributions

pikepdf-0.10.0-cp37-cp37m-win_amd64.whl (904.9 kB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-0.10.0-cp37-cp37m-win32.whl (772.1 kB view details)

Uploaded CPython 3.7m Windows x86

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-0.10.0-cp36-cp36m-win_amd64.whl (904.9 kB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-0.10.0-cp36-cp36m-win32.whl (772.0 kB view details)

Uploaded CPython 3.6m Windows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-0.10.0-cp35-cp35m-win_amd64.whl (904.9 kB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-0.10.0-cp35-cp35m-win32.whl (772.0 kB view details)

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

pikepdf-0.10.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-0.10.0.tar.gz.

File metadata

  • Download URL: pikepdf-0.10.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-0.10.0.tar.gz
Algorithm Hash digest
SHA256 644c26129057eff02f45265a662aebf3baf982cbe562030865f2484c7b5c0018
MD5 4971a9d8725bc6c57919d7bd6dc011fc
BLAKE2b-256 238dc365a1676f127b5d1b501704cf99c34183c67771b4be9ed21f74f868699b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 904.9 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-0.10.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 1cb11c14004521483af9229dba4763e35815491675815927a1801b30fbcbaa67
MD5 628b31c9d4fc534cb9f879533d3740bc
BLAKE2b-256 b5027d4b5583ebf6b0e05ffd9cb6a84fa3d6146e4dd82a5a0d120012a3f63f34

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 772.1 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-0.10.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 7d5b680bc2a9c6de7f7754512ed3853cc60839a1300b75220365405e92689ae2
MD5 5dcc1a63e4308b47013a00438aef6307
BLAKE2b-256 949ac0e987945a6d5571fdab400badec4d9344d97e7963e3bba7cfaecd689d68

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.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-0.10.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5f48cbb7bf988df52a4ce1afb2c8c8e9c14022747ea9c20b61eba963c46a7d69
MD5 f04f6d5ca69ba8aef6859fc07b7354a3
BLAKE2b-256 86503f11a617eaa0f737ebc1de6549855f9bc82fa800a15f16d1d5435ed04bfe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.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-0.10.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 2a088d0a49223902b7199a5ea8002352867218c769329a7546201d9402d11130
MD5 de4020ab054523131022827a6d15f968
BLAKE2b-256 98fddf810314702b4541f63e102655fd5397f8f1332613e2a5c371d2cb7aea46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 904.9 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-0.10.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 030dad515273d52eb159c2c4e012f11e5e2a9e45f818d8c0f0da613fb7e8fefe
MD5 6536eb64d70a54793686683df56b0a15
BLAKE2b-256 7344e6439257e9a688047120de640082ea4aeb521dc4dc8b317611ec89a4cc31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 772.0 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-0.10.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 210959712f99be99d426991bb388669c93486c4a5f9f8da8a2ffb030910d2f27
MD5 5ddb9f14cca2e0408edf15f3fa792ba6
BLAKE2b-256 fa3ddb11f7f6a054d3256891aa944373caea7d04a7e8b2525e7d66b0819db875

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.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-0.10.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9a7cd329ebe99072ca91f3ee5e565c832df584e61edd53586115897daf5927f1
MD5 64b93df431587ac96c9ead2b4a4a4a0c
BLAKE2b-256 20b773a7da635a5c2aad967e891ba6f83d39b12f17f396170ac2ed9df53da577

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.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-0.10.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 97bc91c293dd6f6e4a22f71b1f5e6b3d82d96b86ad4ef52a5bcba0c69b316e9f
MD5 e924b109aba95f98444d79b6bad95f79
BLAKE2b-256 28558c3216c07217fbc8df3c2c32c0adf670577d2ac0f5a2bda2d1f3ee61b019

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 904.9 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-0.10.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 848d9bdc509880a0d45d9e1588426d872c4e4574ff7bf491af3db5a4976d61ec
MD5 35fa6756f66866aaab214b530de135ad
BLAKE2b-256 1c38042dcd57c5ce89715cf8bba5e179b453f2c852913d3d1aa77216e3c8c1b1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 772.0 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-0.10.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 737ce54c9a1cfd65f9402673eee0e1a03ac297627fa8cf38f22ecbffaa565722
MD5 7d7e79b3139f166ac7769f4292f6c7d6
BLAKE2b-256 5f77fbbe1ecdc4c84c029298df716a862694b22cc6833a5ab4db91003c030dbd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.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-0.10.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2a34bd5123b9f4287048e36a53a2d0d65e265ad2702010393ded7d4bc7229aa6
MD5 f160722ca5b57930378727a5fc30322e
BLAKE2b-256 6e3594927fd0f82c98f5c138a5d38e99c2388b78d0848c84e41de87b53cf15f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.10.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-0.10.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 cf899bfa1b4dd8b288aa3e00d9071f91218e25f1455f54343bd0b5e409fcc490
MD5 270f6d93b1807797fd1b1c86276eadb6
BLAKE2b-256 4a57d055883d15c0da5c5dd102d2df8893f28a092265b1756d3035d781f8a912

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