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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

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

Uploaded CPython 3.5m

pikepdf-0.9.1-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.9.1.tar.gz.

File metadata

  • Download URL: pikepdf-0.9.1.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.0rc1

File hashes

Hashes for pikepdf-0.9.1.tar.gz
Algorithm Hash digest
SHA256 13996696e3359180ef69ddad3c18d1c0a0f94671083cf88e72fc60fd12430ef5
MD5 e858490f39976c4e7a1f16e970297195
BLAKE2b-256 ded79a7281ad77075be1d3d4446e66f3aa20f28ebab7d381bca654e8b55580c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.1-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.9.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 498ce8a0c76681389b87ef10d1e8952a1843ddab981591b6757c4fba0a2b8ce0
MD5 ea638f72fe27d718c1e05971625b2ed8
BLAKE2b-256 85900175d71d0a7469511781c05ee28cbf9f7e3c2de90030d2e9b01d26ef7e70

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.1-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.0rc1

File hashes

Hashes for pikepdf-0.9.1-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 51fb7bd3238904209a5f78293a1da2fffc82dd223a58fd66c2db90cb323008dd
MD5 709421004dcb618b5c46172574d61ebc
BLAKE2b-256 a2c128c587356dcdff2e71bf35a977693635aad7ba15a9697e993c7572466af4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.1-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.9.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 101869095ca9a9fee84dd5f30577eada493c8ea1d5e464edd352ab5747ad92d7
MD5 ddac484f0e2621f1609aba6f6cccf9ec
BLAKE2b-256 0a941062106cb9a911ec228d2437f798a170c96136a0d1c4eee05fe8e9925a94

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.1-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.0rc1

File hashes

Hashes for pikepdf-0.9.1-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 d2e7115a90ef76b4ae246ca147757bafd97ad88af436e2fc179083dc2bcad899
MD5 ad5a1f3b38cf39d8052a04323bbf60ee
BLAKE2b-256 c456ace94a739df97020186321b7d395abb11dfa853fb5a6632b924267f8f6e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.1-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.9.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fb2cbbca40c742822776bc1a94cab51b2a03f49fdf4167752a06d5a685d73c3c
MD5 8dc8d839afcdc932c2a8e05495ed54d0
BLAKE2b-256 6b45b47a954ed371628f2629c714f97e3a4a08fbddabb815ae28b0517daba554

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.9.1-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.0rc1

File hashes

Hashes for pikepdf-0.9.1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 0a9dc0bd26d98e08820ea4f6a3224680714fe6d1d0d4b79e845b7f4854263a34
MD5 ce2bd066c17512a9585614f9d55dcf13
BLAKE2b-256 88eabd3600043b1c59659827adf119a2b6b1967092820834724f8ad7672afda9

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