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

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

Uploaded Source

Built Distributions

pikepdf-0.3.7.post1-cp37-cp37m-win_amd64.whl (892.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-0.3.7.post1-cp37-cp37m-manylinux1_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-0.3.7.post1-cp36-cp36m-win_amd64.whl (892.0 kB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-0.3.7.post1-cp36-cp36m-manylinux1_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-0.3.7.post1-cp35-cp35m-win_amd64.whl (892.0 kB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-0.3.7.post1-cp35-cp35m-manylinux1_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.5m

pikepdf-0.3.7.post1-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.3.7.post1.tar.gz.

File metadata

  • Download URL: pikepdf-0.3.7.post1.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.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.7.post1.tar.gz
Algorithm Hash digest
SHA256 55f757912849c442481279701a4606ec06ff0bb82b73c9c9f1e6387a24a2219f
MD5 299e4594f0edc4f92a270ff2679a82ce
BLAKE2b-256 213306df1576fce15d9dc6eae17264680bfd3c632a5c23738b30f2a15dc5f6d1

See more details on using hashes here.

File details

Details for the file pikepdf-0.3.7.post1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pikepdf-0.3.7.post1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 892.1 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.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for pikepdf-0.3.7.post1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d5daa0de66fb80385a68f0265f4e91f52f73114ec7f2d8db548e9489d52b5edc
MD5 03238e593f8086b4dff7dfd14c8adf6a
BLAKE2b-256 8f67aa3b8f6ceb2a8e6585e203174e2f477dc4cfb1f302690ae9af7da9525ead

See more details on using hashes here.

File details

Details for the file pikepdf-0.3.7.post1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

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

File hashes

Hashes for pikepdf-0.3.7.post1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8d40eb6a018cabfdc5f5f4f21fe417e90bdd33d5ee22b26255f30c3742bfaade
MD5 4f7ad361373e7999043c0111c4b1d4c4
BLAKE2b-256 c0a70c7e68aa2cef3ba2d071175e2d572a2211b5c501c059ea112adc049d4b05

See more details on using hashes here.

File details

Details for the file pikepdf-0.3.7.post1-cp37-cp37m-macosx_10_6_intel.whl.

File metadata

  • Download URL: pikepdf-0.3.7.post1-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.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.7.post1-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 936c53a0d91dc1e9693aadd0e266e9a4f7f40441aee7575cc6f32f18299094b4
MD5 6c1da8c9dd221510072fa5dbad7f204e
BLAKE2b-256 839e908a846ba5731344f3c6b95d4d69fa9f8f8770a4d1ed9e0f77ced211c264

See more details on using hashes here.

File details

Details for the file pikepdf-0.3.7.post1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pikepdf-0.3.7.post1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 892.0 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.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for pikepdf-0.3.7.post1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e25494e42f0e06ac07b3e5447f82769e1f81ae3456a583f7e2bb180c793a554f
MD5 594edba2cd146afe4de64a61cc58042b
BLAKE2b-256 4669469103b6fc9410a3d9dd1cf66075f8f043a696818432be743d0aca4e7d9a

See more details on using hashes here.

File details

Details for the file pikepdf-0.3.7.post1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

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

File hashes

Hashes for pikepdf-0.3.7.post1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a6b9095ed0fc89a5f3e597afa349220879eee00896c1276edf49863e0768b208
MD5 2a64d52b8bfe762e55371da836ba385e
BLAKE2b-256 7194627856df652ba1a5f278a195590d50b71cf7aff31e374e287f7e16bf59e9

See more details on using hashes here.

File details

Details for the file pikepdf-0.3.7.post1-cp36-cp36m-macosx_10_6_intel.whl.

File metadata

  • Download URL: pikepdf-0.3.7.post1-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.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.7.post1-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 2cb6149c12b97554c935ed455cd6376d9be5bc8edb05948ef7b0a5005e0d036e
MD5 642258f9cf47525befa39726e1c365be
BLAKE2b-256 ceb2058e641e0fd83ee993441bc853ed8827e0ac0eb790e4a372510363ab4882

See more details on using hashes here.

File details

Details for the file pikepdf-0.3.7.post1-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: pikepdf-0.3.7.post1-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 892.0 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.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.4

File hashes

Hashes for pikepdf-0.3.7.post1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 33b0fe5bb7845885b4e6859419c47a8c9ca3e104f7a887cb05aa8abb66ac5f42
MD5 0aefd883cc5659af8008687be380fcf9
BLAKE2b-256 ca54f692a8cbc23efbe794996bb65df0283a39e0471c717524d9ea5a3189b543

See more details on using hashes here.

File details

Details for the file pikepdf-0.3.7.post1-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

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

File hashes

Hashes for pikepdf-0.3.7.post1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 16b1f3729a898108fb2ca798331fdb3c84952da7138fbbc952b9e5a1645f61a1
MD5 e0a1af59a5894c9d213fce15e81e8878
BLAKE2b-256 a8b7f6a75099d00caedb02bb06edbbb7bdc42e2003d611da54bdcc7103901d0c

See more details on using hashes here.

File details

Details for the file pikepdf-0.3.7.post1-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

  • Download URL: pikepdf-0.3.7.post1-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.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.7.post1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 e7dac7b096e989e99e6fe0e52c889c80a3a1ad468636fb2c63b040cfd514a76d
MD5 9f53344c16e3c8b9ce5334d10e723374
BLAKE2b-256 674a223011c7ee1c7d85e8647d46034cb21f6e13aba8025ae31ccf90c64f274a

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