Read and write PDFs with Python, powered by qpdf
Project description
pikepdf is a Python library allowing creation, manipulation and repair of PDF files. It is provides a wrapper around QPDF.
Python + QPDF = “py” + “qpdf” = “pyqpdf”, which looks like a dyslexia test. Say it out loud, and it sounds like “pikepdf”.
This is in early development. Expect breakage.
Python 3.5 and 3.6 are fully supported.
Python 2.7 and earlier versions of Python 3 are not currently supported but is probably not difficult to achieve. Pull requests are welcome.
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. If you don’t need to read existing PDFs and just want to produce PDF output, reportlab or wkhtmltopdf might be more suitable.
Installation
pikepdf requires qpdf version 7.0 or higher.
On Unix (Linux, macOS)
A C++11 compliant compiler is required, which includes most recent versions of GCC and clang.
clone this repository
pip install ./pikepdf
On Windows (Requires Visual Studio 2015)
For Python 3.5:
clone this repository
pip install ./pikepdf
For earlier versions of Python, including Python 2.7:
pikepdf requires a C++11 compliant compiler (i.e. Visual Studio 2015 on Windows). Running a regular pip install command will detect the version of the compiler used to build Python and attempt to build the extension with it. We must force the use of Visual Studio 2015.
- ::
clone this repository
“%VS140COMNTOOLS%....VCvcvarsall.bat” x64
set DISTUTILS_USE_SDK=1
set MSSdk=1
pip install ./python_example
Note that this requires the user building python_example to have registry edition rights on the machine, to be able to run the vcvarsall.bat script.
Windows runtime requirements
On Windows, the Visual C++ 2015 redistributable packages are a runtime requirement for this project. It can be found here.
Building the documentation
Documentation for the example project is generated using Sphinx. Sphinx has the ability to automatically inspect the signatures and documentation strings in the extension module to generate beautiful documentation in a variety formats. The following command generates HTML-based reference documentation; for other formats please refer to the Sphinx manual:
cd pikepdf/docs
make html
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 the license.
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
Built Distributions
File details
Details for the file pikepdf-0.1rc3.tar.gz
.
File metadata
- Download URL: pikepdf-0.1rc3.tar.gz
- Upload date:
- Size: 951.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32e2a47600f0ba4771015320a5197e54ddeb79accbae4176ddefc8e1cc265173 |
|
MD5 | e00d28c16a10a5168606e33dbb4042d1 |
|
BLAKE2b-256 | c2553c2ae51b11105428ef38e3fb665f8975a0919bdfeeb52932ac943aff4237 |
File details
Details for the file pikepdf-0.1rc3-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pikepdf-0.1rc3-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 5.0 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed14b40f38ebb2cb021e8f950624c286e5b4500a5d5b2ebfe4c2315272148e8 |
|
MD5 | a0338458a925cb2803a7550f0e7a2bb9 |
|
BLAKE2b-256 | c5df52f9e70effd135cb4aeb926a783c5952e131b6b0eeb3f0c1519db4c2d988 |
File details
Details for the file pikepdf-0.1rc3-cp36-cp36m-macosx_10_6_intel.whl
.
File metadata
- Download URL: pikepdf-0.1rc3-cp36-cp36m-macosx_10_6_intel.whl
- Upload date:
- Size: 842.2 kB
- Tags: CPython 3.6m, macOS 10.6+ intel
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc72ff2a24bc5951698c2da69dbd0d4fb47f9afc212853753b399d52d72c1e61 |
|
MD5 | c1d6bd3e64fc4e135002b3e305642760 |
|
BLAKE2b-256 | edcd394f5f84f80135aba8dbead867425fa2687e31a528e341e5c48530dbe4b7 |
File details
Details for the file pikepdf-0.1rc3-cp35-cp35m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pikepdf-0.1rc3-cp35-cp35m-manylinux1_x86_64.whl
- Upload date:
- Size: 5.0 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c445bd71cf66ac41c354788568d03bc228f7e1abf70e76c5ed6e1ea83e0f72b |
|
MD5 | d9980db70a62d73090f1e71fdcad779d |
|
BLAKE2b-256 | 3d0ec9dfda9d31b55b6e51f7ff69f08b98398d7de43184fe52073af1e2b7ffab |
File details
Details for the file pikepdf-0.1rc3-cp35-cp35m-macosx_10_6_intel.whl
.
File metadata
- Download URL: pikepdf-0.1rc3-cp35-cp35m-macosx_10_6_intel.whl
- Upload date:
- Size: 842.2 kB
- Tags: CPython 3.5m, macOS 10.6+ intel
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a27f0a10d0ef1ade2c95caf228ca83ce203550cabeac6986ceef3459c429fbae |
|
MD5 | 7d91ebfe55f88080971aca1dc9a535bc |
|
BLAKE2b-256 | 3906c1a34e08a08963f65cfce144de2d3da4ca539c5930d898474f5823fe55ee |