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

Uploaded Source

Built Distributions

pikepdf-0.3.6-cp37-cp37m-win_amd64.whl (891.2 kB view details)

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-0.3.6-cp36-cp36m-win_amd64.whl (891.0 kB view details)

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-0.3.6-cp35-cp35m-win_amd64.whl (891.0 kB view details)

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m

pikepdf-0.3.6-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.6.tar.gz.

File metadata

  • Download URL: pikepdf-0.3.6.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.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.6.tar.gz
Algorithm Hash digest
SHA256 59dcd6d4b877a1fb079ed1d00854798219f4320e6c431f4e3ea98ca75bd435b6
MD5 b076b3fd57e9f615878f1d58d18c629e
BLAKE2b-256 5a6b86d3e77c766cbe55e78d23eb36426eb90d07fed238ec4e046a0fb1ac5b3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.6-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 891.2 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.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for pikepdf-0.3.6-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 105d595dd918e81331b8077c0d468326fe940b65a167cfe8d557ba4ecceb19bf
MD5 67fa647c3ec0915d87a5754b92daf7e0
BLAKE2b-256 f9cf5a6cbcf8db639b2280e1e625d2a0da4dd3975acd7054e73658d54b19e598

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.6-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.0 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for pikepdf-0.3.6-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 91aa36fbbbbf1cb67e7c17fd5f2469ef61ccb1be19f6031b8251c6c8fa835c7a
MD5 fe8fe104fbf890c182bc88bde897bd5f
BLAKE2b-256 4e4707397cda9b60ef1a887c1f3e787dbd7996888799ce79455a53a41bbf45fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.6-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.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.6-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 17ea2b003fcb2b85e2b159a0fa6d6675cbb6e934e3c05f3a257738e67c037362
MD5 dfd477644b22ad769e487c627265ad3d
BLAKE2b-256 4a65ce993148afde7ec64ed6f3dd74b25edb3388ede86cd3e43589b28882786d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.6-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 891.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.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for pikepdf-0.3.6-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 be9d3cae74a967c4c19f9c3d19464cc40b03b1924fc36c1626ab7d364e34d41e
MD5 143762524b3e22b6a759e47090bddd48
BLAKE2b-256 d35b72b7fd59631acce32bf277ad0dedbd5a5a4295c931a549080fce17b6e7ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.6-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.0 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for pikepdf-0.3.6-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ee9ca1618e5aa7777b8687c68fab44c5270002bbf0c8ae4d34bb26a0eca4037c
MD5 e2f2d85c7d4ea2483a5f0345db98bc2d
BLAKE2b-256 e53bd06b6361166f58d60606a959cca672f5d88f0e08fec72f4732fac8a9db5f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.6-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.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.6-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 228ffd4c060ebed60676df3b5fec5303c2148e696f321f265fdbda36f87a5103
MD5 ec4ec26105271852570cdec693f8deb5
BLAKE2b-256 da28cf5bee088defd04eceb63cfa7fc409a8205f74449f557e1dba0fab05a499

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.6-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 891.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.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.4

File hashes

Hashes for pikepdf-0.3.6-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 984efa667e86970be58ba68b5d9cbb33940728c69d1f006d4e58144731d4884b
MD5 8c2deaf52856fbae44455657c6fdbfe9
BLAKE2b-256 b6f47d6ab94912d4ec16828de0cb8573065a11fca945cce84e074f7c1ed283df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.6-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.0 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for pikepdf-0.3.6-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ee97927d81632a031f6e7222071b528841adce955d1b4b4d8eebf3b65fc117ff
MD5 72e4dabc7e4bd13166e3e6c9d0923356
BLAKE2b-256 d9b195fb90eb36bfaadc9bb204beb9327e948041930bb55f3bf017fc3fe9d724

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-0.3.6-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.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0rc1

File hashes

Hashes for pikepdf-0.3.6-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 d1f9ff4749580a2015505e5a42b4246581d76332f5d6590a3d8a74e1d9a973bb
MD5 be3be3198102ec0a719eb88e7c8afa99
BLAKE2b-256 d8e3f054fd87b89e1f150266d5004b6965750ff53263936797d6052003702a5d

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