Read and write PDFs with Python, powered by qpdf
Project description
pikepdf
pikepdf is a Python library for reading and writing PDF files.
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 | |||
Test suite coverage | ~89% | 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.
-
pdfarranger is a small Python application that provides a graphical user interface to rotate, crop and rearrange 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 debian/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
Built Distributions
File details
Details for the file pikepdf-1.19.3.tar.gz
.
File metadata
- Download URL: pikepdf-1.19.3.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78dd7990b049da841134b578537f190f00b42a80575903f8c9f59bd68dd8eabb |
|
MD5 | 79c4ce2171b16e7e1519ee37e649c1bf |
|
BLAKE2b-256 | 302b3da17ebb6f3e9f165176a101848bd87bc3a15e68b9f12a93725cb309af43 |
File details
Details for the file pikepdf-1.19.3-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee43e2785f1ed01c3301d7895a8e7a27d0e1ad2693ec3346268c2e2564125a0f |
|
MD5 | b2b31a13940a5ea1d65dbe1cff8fe274 |
|
BLAKE2b-256 | a27257d5e17c78ce32c7c68d628bdbfa1e3ead5cefc17fb323134a691e79e774 |
File details
Details for the file pikepdf-1.19.3-cp38-cp38-win32.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp38-cp38-win32.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b936188046f21ed3e6f3b8f7f194acbba59fa003c6055d4a30af8905b4461dbb |
|
MD5 | 2c04ade313c4fee45023e2798c496fc5 |
|
BLAKE2b-256 | 0c1540a934c23bbe99a17662e8979111013f3ef66642520959d1abc1dee37654 |
File details
Details for the file pikepdf-1.19.3-cp38-cp38-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp38-cp38-manylinux2010_x86_64.whl
- Upload date:
- Size: 10.1 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 304553140d85ab789994cbe218813e5e7b60d7c033c3fbe504d7b82f811f0c96 |
|
MD5 | 8b8e3bc150b15217e91017041e7e6dbb |
|
BLAKE2b-256 | 38500d588e236645220521a583b15093d645bd2586761bcbc4c3242697694ade |
File details
Details for the file pikepdf-1.19.3-cp38-cp38-manylinux2010_i686.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp38-cp38-manylinux2010_i686.whl
- Upload date:
- Size: 9.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa38068fe309b32a3ba882ff6bd63575c72c63d6f95732b41d6d1c92d5a29cfd |
|
MD5 | bfc220037317f948f58035d65dc96363 |
|
BLAKE2b-256 | 70ca7ab2fddcdb4478169bb37db69eb03652f2c6af41cf0419c190918f0a40cf |
File details
Details for the file pikepdf-1.19.3-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2296f9785d71e317d66ef7a1c7a16acf69195826bfc8aea359d4ca6b4fe19a08 |
|
MD5 | 736eb4d01a150b3a9912eab934a24e91 |
|
BLAKE2b-256 | 801a0354d0d2823aa7a66db4fcd1796c4908582b6d21b1574083fddbaf14101d |
File details
Details for the file pikepdf-1.19.3-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 247121a29f430b159dd21a0ed89141ffb1a6f13c7ca55f5dca2608c142206d72 |
|
MD5 | 07b32bc6a6876a0082c3d0b33beea142 |
|
BLAKE2b-256 | 72f5e3f5c8889401ca1810144bd5be8954f6d90ac2a90dc499fc106ce20a1bc6 |
File details
Details for the file pikepdf-1.19.3-cp37-cp37m-win32.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp37-cp37m-win32.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18c11f1bfd5c0a1ef225311af5e734f1645f733583e417b15eb83bef3e94e88e |
|
MD5 | 2f8250e3e7af5ae6c360b93b8923b57d |
|
BLAKE2b-256 | e24d3879d6b1e067d72e7a6187ebe1bb83df1f0aeb31defcdbe7e2513252c4fc |
File details
Details for the file pikepdf-1.19.3-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 10.3 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08f9fefe3dbc002274c2b3f51ff3135b647f6ae17656f596a357fdc3f1dd1732 |
|
MD5 | 52fdfb20e66182831760620a44e5f07b |
|
BLAKE2b-256 | 18ac3f4f63f96456b019be6e26d351dd6bc88431b4234738f53fa29134aabbbe |
File details
Details for the file pikepdf-1.19.3-cp37-cp37m-manylinux2010_i686.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp37-cp37m-manylinux2010_i686.whl
- Upload date:
- Size: 10.1 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37ca0a76def171c1c372e6d5602435ee33c41531d7e1916efda98a25dbf654ae |
|
MD5 | 31101d915b2cb5a20404c39c94c3db78 |
|
BLAKE2b-256 | e1e28b373ef0145eb8e862ce883b25d39207f6a023458c46b25a544aabf494cb |
File details
Details for the file pikepdf-1.19.3-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 995.1 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f38e273897bad31786361e4bb926472fa148773cffd9588914086c46207c51a |
|
MD5 | 99dc4acbe2b9b9bb283797cdb8feb236 |
|
BLAKE2b-256 | 1bad8085936784a499a6396bd9d71647f4cfb5c8718da9fcf5cec0cb5254891f |
File details
Details for the file pikepdf-1.19.3-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1bb882936ff9c2f4edd437ba48bf5360c0c3dbfc1dc57391c1203c681d9ec89 |
|
MD5 | a119f045b7d9040325795342bbf26def |
|
BLAKE2b-256 | d484bf944172c3a5cea55b264f8401c24aba4551e49a786bbed73718ed63cf47 |
File details
Details for the file pikepdf-1.19.3-cp36-cp36m-win32.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp36-cp36m-win32.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.6m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11cf286c89a956df806f0b466447a79eaf295b642e56c4b3ff05749885d2dffc |
|
MD5 | 0404a861db63a7f7571af166be1a0fdd |
|
BLAKE2b-256 | 8efff3b62a6b03adc1fefda577375788e053b4b5e3d4754bfb176aa270cc5011 |
File details
Details for the file pikepdf-1.19.3-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 10.3 MB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aaea584388a55859fe07c5e99d849bc418216db6840765369027ce4126afb8f |
|
MD5 | 984638e4a12b20105f7c426de93df136 |
|
BLAKE2b-256 | cd43393c6ea633aa323ebe014e88265b9f004f1cabda5ca5d67b9e3370f2312d |
File details
Details for the file pikepdf-1.19.3-cp36-cp36m-manylinux2010_i686.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp36-cp36m-manylinux2010_i686.whl
- Upload date:
- Size: 10.1 MB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d9bed8ef3dfbbab5636e12c607c454ba42997f308dbc93d50bc8a9f10e85827 |
|
MD5 | c8223243878d326fc00e7f4e904bb485 |
|
BLAKE2b-256 | 56ced36593ae3d1024017fb323a1e6cd329d8d040d6dbd043795894343f39b6c |
File details
Details for the file pikepdf-1.19.3-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 995.0 kB
- Tags: CPython 3.6m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 037b7ed0b3b0d578ba37856d5e20c2502ad0c3a4d4179b92ffc80dc126b6a351 |
|
MD5 | 84434e1d701500f252fffc455fd3083e |
|
BLAKE2b-256 | 947dd52507ab342c60a624933652f066fafe5b6b91e1a7723ade150fe8a297a3 |
File details
Details for the file pikepdf-1.19.3-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c05cdfc5dce778ab7ce3e1618811a6e44ca7e7a867c8a6a5483bd67ca5d67f8 |
|
MD5 | c4c79a0d13afb09d58b9ec7942dc1f29 |
|
BLAKE2b-256 | dfcf6168705c650ca90dec42086814011805fc3a4d197b9ce317bcd5b1ac810c |
File details
Details for the file pikepdf-1.19.3-cp35-cp35m-win32.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp35-cp35m-win32.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.5m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 005fe96a5fc11c736810dfa1cc300e9d315bd63e0f46efcdbe52a877deab4032 |
|
MD5 | b5a65b52b1cf0a14caa460f51c33feb2 |
|
BLAKE2b-256 | df19c546a15de38385e831720ef066f94551f116aca519da430ee6ae6b8f71a2 |
File details
Details for the file pikepdf-1.19.3-cp35-cp35m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp35-cp35m-manylinux2010_x86_64.whl
- Upload date:
- Size: 10.3 MB
- Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b7fcc7db99a674c2166ae79ed9305b61c77441b7bd56243e6be6d3186cad969 |
|
MD5 | 834bcdcf0a7d2f68e85a95f6d92204b7 |
|
BLAKE2b-256 | a8e862e6049354f06a0b754911d2dc9f9bd3096c12739c68baaa1248e4766ebc |
File details
Details for the file pikepdf-1.19.3-cp35-cp35m-manylinux2010_i686.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp35-cp35m-manylinux2010_i686.whl
- Upload date:
- Size: 10.1 MB
- Tags: CPython 3.5m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f00abb72e1ee5cb9f71ed93747337fb7b94386d38c114c8d4998e54df1056c5 |
|
MD5 | b4239661e6f031aacbc8a810d828983a |
|
BLAKE2b-256 | 19337b0402e146523e0cbd2356803ff3b948915004523f069d444def8c2ffd95 |
File details
Details for the file pikepdf-1.19.3-cp35-cp35m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pikepdf-1.19.3-cp35-cp35m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 998.1 kB
- Tags: CPython 3.5m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 584230f7494da6f5e9c8e4ae890a3f74d74d8f37d65a7be051f859162338bc68 |
|
MD5 | d9d358b7c6de64d7db82b4f7122b7a24 |
|
BLAKE2b-256 | d76d5ad71fff4343dcba7425bbf2969c362ec07d1cde00b71f321956960a0f0c |