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

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

Uploaded Source

Built Distributions

pikepdf-1.2.0-cp37-cp37m-win_amd64.whl (999.5 kB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-1.2.0-cp37-cp37m-win32.whl (835.1 kB view details)

Uploaded CPython 3.7m Windows x86

pikepdf-1.2.0-cp37-cp37m-manylinux1_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.7m

pikepdf-1.2.0-cp37-cp37m-macosx_10_6_intel.whl (1.2 MB view details)

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-1.2.0-cp36-cp36m-win_amd64.whl (999.4 kB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-1.2.0-cp36-cp36m-win32.whl (835.0 kB view details)

Uploaded CPython 3.6m Windows x86

pikepdf-1.2.0-cp36-cp36m-manylinux1_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.6m

pikepdf-1.2.0-cp36-cp36m-macosx_10_6_intel.whl (1.2 MB view details)

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-1.2.0-cp35-cp35m-win_amd64.whl (999.5 kB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-1.2.0-cp35-cp35m-win32.whl (835.0 kB view details)

Uploaded CPython 3.5m Windows x86

pikepdf-1.2.0-cp35-cp35m-manylinux1_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.5m

pikepdf-1.2.0-cp35-cp35m-macosx_10_6_intel.whl (1.2 MB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

File details

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

File metadata

  • Download URL: pikepdf-1.2.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.2.0.tar.gz
Algorithm Hash digest
SHA256 57786a6037a0b1a21943c90f6ac4db7536a5198227a04eb704fd8604a43117e6
MD5 38535105f4695a0d3a7d05d919716f43
BLAKE2b-256 b8d2d695377960ac29b4ae6317c8d5cf90914360be0aff46c4107a3c022e985f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 999.5 kB
  • 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.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.2.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 b7f1c00a534ad1d8847e8760432341497dd850411eae176145cde01d9c7f0ee5
MD5 3d01f54afa207ec96ce2afb381c3322b
BLAKE2b-256 a66425c81959c9916174cd5c95bec04bb7e1fc5e30217000a10502242473c7b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 835.1 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.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.2.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 901d0e6c489fc5d8304ea62762699f73fb8109064e5ca4f1b08b952e8704c15e
MD5 2231afc8e98325db0b1da129a7d68ecf
BLAKE2b-256 95b1571a2ab3966720c407121c0eeedf8e612830a8604a2aad109e4a0bf5eaff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 9.6 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for pikepdf-1.2.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0343a0db95cd7a15c095bac76f07c63e70924943b7c2fc3373245f9d5b7b8aab
MD5 16cc8396bdb704c932e022bd8a9864f5
BLAKE2b-256 81193f572ba30aea6a3f9310987fd300c69e1fb5f184dba047eb93d9ddb6d3f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.2 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.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.2.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 5fc55e0c83256a0dd812e8eb93643514c27fc1250662af01ac70899e8e7b1c63
MD5 c98a9936b3c0185338954ddaf1b5afa3
BLAKE2b-256 942eb217cac87576f857362f9dff63da2a3bd9895e511b077d002ff2b4426af9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 999.4 kB
  • 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.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for pikepdf-1.2.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e7acb5de5e7529044f86be45619a20864d6496ca5367e7baf0e2a8b468749c28
MD5 7604cd0e8a228eb493d6a2a3c42eb61c
BLAKE2b-256 041b767a5db52cb365835041062a4d6a6859d16c7b463c5cf0cdd6f186ff4772

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 835.0 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.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for pikepdf-1.2.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 63c460d0e003dd0b210c897ac6dd02635f3be264d7802241ef06e820506715cb
MD5 f73ce1a496530317ae53c7f70ad091b8
BLAKE2b-256 f46e9dd7ef0d26264e74e47677ff3200abeded79c1444ba5b81141ead7fc36ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 9.6 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for pikepdf-1.2.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 19e639628f5a85e9702cbd1b80cf7ea701a35cd790806a2ff334c1cc623c3fda
MD5 775060740a45a70228952e078b110965
BLAKE2b-256 bea61d753d41818b59c24ec2f08dd993f856947145fa576fcf0cf775c2bd52b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.2 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.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.2.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 03921b37a693a1e8d5f7c2abd86695890b5c60b474e070594b77aab9ff4fde15
MD5 6a5c429db93ce886d3fa00a70e637314
BLAKE2b-256 8165b2e7683ad56e435d94a652395c8a42d9a504749299bc33a7638d525c9216

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 999.5 kB
  • 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.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.4

File hashes

Hashes for pikepdf-1.2.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 e49ae3402bf9fc6dc55417751d1e07dc7407d5baea2680ddf0e224f121c5fa91
MD5 cad502b476509c9eaa7ae6aeabc834a2
BLAKE2b-256 8e43af6b99a985d322fc7bd8fd62ecf4e2226a03f328d8e3914a228a97e49ecc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 835.0 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.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.4

File hashes

Hashes for pikepdf-1.2.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 ee7a2a5135bf58e945662b99f5ed207d326c003fc0f8fd71bd7627f96b8599d3
MD5 4457dd71f0e8c5e43ea6547f0bc5abfb
BLAKE2b-256 a47388ec76ef5cb2983ea996200210893ae1e1e1481ab5aa0b184e6992fa4fd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 9.6 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/38.2.4 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for pikepdf-1.2.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4e79a4ad14151dac1a185ed9a5c5660a9b46c3541bcfbd535fef2d8e7dea79ed
MD5 abc498d683f4062a558d806bb6f19d7e
BLAKE2b-256 a4e4d0377995e353c8a90391775d35caa3267233bff260242f5487b1a9e1b29a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.2.0-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.2 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.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for pikepdf-1.2.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 99ec815af2b9fb820fe51f31e9c29dfa3ddb27a44effc96c8a4882d4e5864237
MD5 a2fa2213ac8ab63e805775cceb5b6310
BLAKE2b-256 11140bb908e6357281a11ee77c4976e99feb9b66215c01dbc030be7dc905d4c3

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