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
with pikepdf.open('input.pdf') as 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.

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
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

This version

1.6.1

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

Uploaded Source

Built Distributions

pikepdf-1.6.1-cp37-cp37m-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.7m Windows x86-64

pikepdf-1.6.1-cp37-cp37m-win32.whl (861.8 kB view details)

Uploaded CPython 3.7m Windows x86

pikepdf-1.6.1-cp37-cp37m-manylinux1_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.7m

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

Uploaded CPython 3.7m macOS 10.6+ intel

pikepdf-1.6.1-cp36-cp36m-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.6m Windows x86-64

pikepdf-1.6.1-cp36-cp36m-win32.whl (861.6 kB view details)

Uploaded CPython 3.6m Windows x86

pikepdf-1.6.1-cp36-cp36m-manylinux1_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.6m

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

Uploaded CPython 3.6m macOS 10.6+ intel

pikepdf-1.6.1-cp35-cp35m-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.5m Windows x86-64

pikepdf-1.6.1-cp35-cp35m-win32.whl (861.6 kB view details)

Uploaded CPython 3.5m Windows x86

pikepdf-1.6.1-cp35-cp35m-manylinux1_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.5m

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

Uploaded CPython 3.5m macOS 10.6+ intel

File details

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

File metadata

  • Download URL: pikepdf-1.6.1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.2

File hashes

Hashes for pikepdf-1.6.1.tar.gz
Algorithm Hash digest
SHA256 918f48c1226f05f620eb8685545f192181f242621408ddbee4758dd3c1f9473f
MD5 cf90fe3c8682bdcffcaa3274e4d1c9d7
BLAKE2b-256 f3dedb85c30a809718d835e7cc4b43eeb9ff31f3ce9c4d1d53aea704cb5887e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6f2aac2bd4ad9831a9b9b115e21f9bd3be8c5f264359e786a0297a08787657b4
MD5 819422b04e2ab15f82e8e92da785bcb7
BLAKE2b-256 831874693543eac6382a82f14479bc73a3af0199af7c90cac5b3e9832f56fee3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.1-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 861.8 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.4

File hashes

Hashes for pikepdf-1.6.1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 9a49fefe7283768b71d51c04af9f27854e7488e10a9d3821271a286849d9be46
MD5 743cbf05ba45d66dd3cc0f997030ddfd
BLAKE2b-256 3ac920768f074fa437f801e95b27261cf389bb5421641c5c9f5232bb4eddd01c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 27f8b6dab18b04e03f2e1ac024e2b1b8dfa30c311e70f6de44a618d61800855f
MD5 62d89cf61a46ac2f0d41b67a5c080ca0
BLAKE2b-256 9e832fdd57357e8cd0cec636a2651939d83bf997be49c7716fb1a6e8fe25a005

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.1-cp37-cp37m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.2

File hashes

Hashes for pikepdf-1.6.1-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 9fafd803f95c1e0e22ade3c809716f02caf2b0dc3dfa03f11c24d41a8600aefb
MD5 98d0d2ee4ac12c0b72a6fc74f396a262
BLAKE2b-256 aeb4321811692048b1693dbcf6ae9f2cf3e95f39f3706667e5223dcaab186e50

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.8

File hashes

Hashes for pikepdf-1.6.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f002b12aeedec32b2aa577d2b9975350354803805f8af453a1bd36a2d94404eb
MD5 b1171e3178e15010e1bdae7848b1aa46
BLAKE2b-256 528deab450a5a5bbd5cd8d65669d4dfa715ce109fdcac84cc1a66d21097fd86b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.1-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 861.6 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.8

File hashes

Hashes for pikepdf-1.6.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 49eccea3f26e5664d931f85c3f93bbc6aed28bd4e5f2b58023a3db620378f8dd
MD5 c784739ed929030df0bd91ea0e1d33d4
BLAKE2b-256 508ae2ca93198a4df7e9e6cd9b32f6ed90393c84738d5e3a9ca52e5782c64af8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9467c2e1dc9ad88da89a901dab63205857db9abe2a0347657815413cfde11e0b
MD5 6dfff1e202977005457affb95d970d66
BLAKE2b-256 a8a12dd37b0f2433d0c0a322bb6045a2fb748fd082f8ee164655c95a672e585b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.1-cp36-cp36m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.2

File hashes

Hashes for pikepdf-1.6.1-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 57d84b1bd46f3ec09bbb301f6ee8df85767329c1197a501b1b4df5ce83613d56
MD5 fcbb039df92ba38f6ec6ffb718a88331
BLAKE2b-256 b9af588f3369ce167c8dd20c7a5e62a95328a679c8bc0141040224913679b612

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.1-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.4

File hashes

Hashes for pikepdf-1.6.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 6a56080bfe30759a4e1bcf8529033799455266c3541e0839e695e17e4e431062
MD5 b316bc030ad5a9ce7442617a31416240
BLAKE2b-256 58773749b4f1cd0e1d13f5952d81f589cd6388ed4badad66d1620c284fdfa13a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.1-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 861.6 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.4

File hashes

Hashes for pikepdf-1.6.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 4c99cc2ff15dc924ac9545c03567116e88406de2c7d7154c607b636d13d84c55
MD5 8b3215021837b836aa3cceb366e17b81
BLAKE2b-256 ead6623ee40046896e10af35d0d5d8f553abf7560b1ea995c19636e77c90dcd6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pikepdf-1.6.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ef6490935a31eae60ed04cda99a062a2c000617be8a4d61fabc9e859dedcc1c2
MD5 375d9993b9419884d4fe6205ff6c002c
BLAKE2b-256 9b4401434667281b9b0eb2db115f11fe09de41d8186291636957e49e0bb5df30

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pikepdf-1.6.1-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 1.4 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.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.2

File hashes

Hashes for pikepdf-1.6.1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 d2721e7b1038a8c17357598c563f90ab264496c1461e2fbf496429930fef7a55
MD5 232feb266fedd8bc0dc0d9e22864749d
BLAKE2b-256 5ace703ab4591dd8d9b11306ecc0f65bb9fa56cd29865c9d5b74678c87794bee

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