Skip to main content

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pikepdf-0.1rc2-cp36-cp36m-manylinux1_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.6m

pikepdf-0.1rc2-cp35-cp35m-manylinux1_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.5m

File details

Details for the file pikepdf-0.1rc2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-0.1rc2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e8c7003b35da751b5f022c21bfdaaa74b7a77c1d31ad9ed21d172859e67e8387
MD5 37b1138eb650601c00db9bb4a7d2f640
BLAKE2b-256 7f43b7c2a7116e61b5c8263c3982e47c3a8770a0a168729222c9b8e40db80b04

See more details on using hashes here.

File details

Details for the file pikepdf-0.1rc2-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pikepdf-0.1rc2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 77486d534caee4a3f05f739260719cbc422d79b7cebae3382b95437dbe6043ac
MD5 81032375c363c44fe43b5b48af322944
BLAKE2b-256 12e4e42fdfb0b67272f87b590b68bf98208f9226dfa17689f9aece9077ad93d7

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