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 PyPI - Python Version

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:

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded CPython 3.7mWindows x86-64

pikepdf-1.6.5-cp37-cp37m-win32.whl (907.4 kB view details)

Uploaded CPython 3.7mWindows x86

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7mmacOS 10.6+ Intel (x86-64, i386)

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6mmacOS 10.6+ Intel (x86-64, i386)

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

Uploaded CPython 3.5mWindows x86-64

pikepdf-1.6.5-cp35-cp35m-win32.whl (907.2 kB view details)

Uploaded CPython 3.5mWindows x86

pikepdf-1.6.5-cp35-cp35m-manylinux1_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.5m

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

Uploaded CPython 3.5mmacOS 10.6+ Intel (x86-64, i386)

File details

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

File metadata

  • Download URL: pikepdf-1.6.5.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.5.tar.gz
Algorithm Hash digest
SHA256 ee935eea84fa5fc1879355de38cd47216e5e922553303ee045c35917e13b2fcf
MD5 c86c3515a2c6e7bb07d9af2f8aec70d4
BLAKE2b-256 de39d196b0fc390639a8844ae65e395df5b44596dadcc442696fd4d3c452ad17

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.5-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/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 816674601c22002669f5820c4739644b42e1494ddeb2d32caeca418e416540b8
MD5 448c67594b656e7cfbfba26273f70241
BLAKE2b-256 a7e7445ae64d6ca8a45d05c1f7dca8e38556a78c547e0c4e9785fca2c13e5eee

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.5-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 53a7e64ae576d91c7df2518f5652f50dad73bcd145e758e054a49bb4f156b2d4
MD5 ee53289220927c88a84373ca9783e1a2
BLAKE2b-256 4ee1cb090bffe79e8bd47650507f389f91a576f9a869705f8039bb5beca7f089

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.5-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ce0d334e0f50d2372f7bb492544e05268994027a18beda6baf1bc4a48a122089
MD5 22e5ace7fc44f9e1269430c89bc51ec1
BLAKE2b-256 13c29689e520789dd9c87491715a870aee2a532eb5ae94e5c189a1116ea90415

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.5-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.7m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.5-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 5deeed6f9ab149322d983e257bc358b4e22f2743b5bcd0070b67b2e6b67d97c3
MD5 15d99d5fc9665850dddea8bb0620dae4
BLAKE2b-256 3662b990ceca48d09158b7121ce770ffae64b379742fd16800858aef3deff019

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.5-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/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for pikepdf-1.6.5-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 61274cab1697ccd93e2d8bf3dba102dfd1388c765a23d011eece6d115ba3d01e
MD5 bb2787b4ac5f06d94f56402df94a9d1d
BLAKE2b-256 05853c446854c1460e45e5c6c70c43ae9a7cf5f7f2a700b190ed7ab914867620

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.5-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 290af6598f6c6061b6619c7e0cd2b5e4571896d6a65bde32d8b982ae4179f83d
MD5 5f016afacb0fd27b89cf4b9ec09b5f23
BLAKE2b-256 e14d35b8b4a60701ae8ce73e27e361d86986756fdc34a7c2d88d12d9ddf1c9c3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e7991d0d6edab1bb120c4722c28c2889bc684b3492384bdee1b71e8623758425
MD5 2be8bb020c26ede4c37b1411e1940c29
BLAKE2b-256 abe404317df4e3d23d4a17cc8928d90fb7e6e28921a2985fd4fbc56b4ba37e72

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.5-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.6m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.5-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 fc45529749a9fec0197fdfc0335ad35609f019c12fa28d29028414d387d3f239
MD5 d604ad52cbd8ebb3290d81d10854f445
BLAKE2b-256 e7ba627ca96e3c499cbcfdb0cf9d458f8082d0cfca0f8938d694bddf58bb1721

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.5-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.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.5.4

File hashes

Hashes for pikepdf-1.6.5-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 2b21cc65da57d6b8da1c45c8b507cff72aa8f6ed75dcc0907c3b2b1969fd42a8
MD5 88d4a9a49e9dec87453de2a8b3ea3226
BLAKE2b-256 66fd2f9380433c65239cbdb10e7176a4d4162a4084a943ab096c508d84c974f6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.5-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 dc31b205466fa5ba2d0337e0b5483b23734182dbe3a4e73b68e6f44345a054a8
MD5 abe4f2a9fb7d1e218e19d66832cfb74b
BLAKE2b-256 88b10a39ed0d66e7c39810d4c33a440363baaa92cf1936fa555da1393b00fdd1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.5-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c64fb2a10807ac5a27c04377bb32257ee3c52b52a38d4adccc9ff131da26f59e
MD5 00cac75872e1a2452e49d6980b71f5c4
BLAKE2b-256 296c6874c6eab9ef18f1064a07d5011ab95eeb3ce3e130449fb2c0f6d4644574

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.5-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.5m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.5-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 350ddc24818efb4b27bb77c91c15cc6aeabd5447e5906d731150cc17e6cd573a
MD5 802680e5d6739372a1cfd822ffc48543
BLAKE2b-256 dbb42053750ea61d314604747b7dcca7e5ceff4059a59deb7aeb7927e47d0965

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page