Skip to main content

Produce & Publish Python Client

Project description

pp.client-python

Produce & Publish bindings for Python.

The pp.client-python bindings can be used to communicate with the Produce & Publish server pp.server for generating PDF from Python applications .

Requirements

  • Python 3.7 or higher

Source code

https://bitbucket.org/ajung/pp.client-python

Bug tracker

https://bitbucket.org/ajung/pp.client-python/issues

Documentation

https://pythonhosted.org/pp.client-python

API

pdf API

The pdf API supports the conversion of HTML/XML to PDF through the following PDFconverters:

  • PDFreactor

  • PrinceXML

  • Speedata Publisher

  • Vivliostyle Formatter

  • PagedJS

  • Typeset.sh

  • Weasyprint

  • Antennahouse

The PDF conversion process is based on the “CSS Paged Media” approach where the input documents (XML or HTML) are styled using CSS only.

The pdf API of pp.client-python expects that the input file and all related assets (images, stylesheets, font files etc.) are placed within a working directory. The input file must be named index.html.

Using the commandline frontend:

$ ../bin/pp-pdf  --help
usage: pp-pdf [-h] [-f princexml] [-o] [-a] [-s http://localhost:6543]
              [-t None] [-c] [-v]
              source_directory [cmd_options]

positional arguments:
  source_directory      Source directory containing content and assets to be
                        converted
  cmd_options           []

optional arguments:
  -h, --help            show this help message and exit
  -f prince, --converter prince
                        PDF converter to be used (prince, pdfreactor, publisher)
  -o , --output         Write result ZIP to given .zip filename
  -s http://localhost:6543, --server-url http://localhost:6543
                        URL of Produce & Publish server)
  -t None, --authorization-token None
                        Authorization token for P&P server
  -v, --verbose         Verbose mode

The same functionality is available to any Python application through the pdf() API of the pp.client-python module:

from pp.client.python.pdf import pdf

def pdf(source_directory,
        converter='prince',
        output='',
        cmd_options='',
        server_url='http://localhost:8000',
        authorization_token=None,
        verbose=False):

Support

Support for Produce & Publish Server and components is currently only available on a project basis.

License

pp.client-python is published under the GNU Public License V2 (GPL 2).

Contact

Andreas Jung/ZOPYX
Hundskapfklinge 33
D-72074 Tuebingen, Germany
www.zopyx.com

CHANGES

3.0.1 (2023-02-07)

  • modernized codebase

  • no feature changes

3.0.0 (2020-02-14)

  • adopted to new pp.server 3.x server API

  • code cleanup

  • better logging implementation

0.5.1 (2019-08-02)

  • fixed Python 3 deprecation warning

0.5.0 (2018-07-14)

  • compatibility with pp.server 2.0

  • removed async support

0.4.5 (2017-08-08)

  • disabled option to by-pass SSL cert checks

0.4.4 (2015-11-14)

  • support for Vivliostyle Formatter

0.4.2 (2015-02-02)

  • support for /api/available-converters (requires pp.server>=0.6.1)

0.4.1 (2014-11-19)

  • experimental support for Speedata Publisher

0.4.0 (2014-10-13)

  • compatiblity with Python 3.3 and 3.4

  • dropped Python 2.6 support

0.3.6 (24-01-2014)

  • added option ‘-c’ to most commandline script in order for explicit SSL cert validation

0.3.5 (24-01-2014)

  • disabled SSL cert validation since Python/requests module can not deal properly with the StartCOM SSL cert of https://pp-server.zopyx.com

0.3.4 (21-01-2014)

  • updated unoconv API documentation

0.3.3 (13-01-2014)

  • support for server side token-based authorization

0.3.2 (13-01-2014)

  • import fix

0.3.1 (21-10-2013)

0.3.0 (17-10-2013)

  • Python 3.3 compatibility

0.2.9 (06-10-2013)

  • added API methods for version and converters API of pp.server webservice

0.2.8 (05-10-2013)

  • added support for cmd_options parameter for pp.server==0.3.5

0.2.7 (03-10-2013)

  • documentation update

0.2.6 (14-07-2013)

  • better error handling

  • fixed issues with format() calls under Python 2.6

0.2.0 (06-07-2013)

  • minor fixes

  • moved documentation to Sphinx

0.1.5 (04-07-2013)

  • implemented poll support

  • fixes

0.1.4 (04-07-2013)

  • added async support to pp-pdf commandline frontend

0.1.3 (03-07-2013)

  • pdf converter parameter not properly propagated

0.1.2 (03-07-2013)

  • logger fixes/changes

0.1.0 (03-07-2013)

  • initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pp.client-python-3.0.1.tar.gz (8.5 kB view details)

Uploaded Source

File details

Details for the file pp.client-python-3.0.1.tar.gz.

File metadata

  • Download URL: pp.client-python-3.0.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pp.client-python-3.0.1.tar.gz
Algorithm Hash digest
SHA256 3d02b87ff0109f8b6aa230c6c742c94be00158bdc2f2642b6ad4e24ba37b2c51
MD5 2ddcdd5995d86b275dd0ed7b437e0780
BLAKE2b-256 364b883fc31a7de495e8aa02aad2196e2bd64d6c560e1b970acf4da9f6fe7398

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