Skip to main content

Barcode rendering for Python 2 and 3 supporting QRcode, Aztec, PDF417, I25, Code128, Code39 and many more types.

Project description

https://img.shields.io/pypi/v/treepoem.svg https://img.shields.io/travis/YPlan/treepoem.svg

A cleverly named, but very simple python barcode renderer wrapping the BWIPP library and ghostscript command line tool. It is also Python 2.7 and Python 3.3+ compatible.

Install

Install from pip:

pip install treepoem

You’ll also need Ghostscript installed. On Ubuntu/Debian this can be installed with:

apt-get install ghostscript

On Mac OS X use:

brew install ghostscript

Otherwise refer to your distribution’s package manager, though it’s likely to be called ghostscript too.

Supported barcode types

It should support more or less everything that is supported by BWIPP, but these types are specifically verified in the tests:

Example

>>> import treepoem
>>> image = treepoem.generate_barcode(
...     barcode_type='qrcode',  # One of the BWIPP supported codes.
...     data='barcode payload',
...     options={},
... )
>>> image.save('barcode.png')  # This is an instance of `PIL.EpsImagePlugin.EpsImageFile`

A file barcode.png should appear in your current directory with a QR code.

What’s so clever about the name?

Barcode - Treepoem.

Bark ode.

Tree poem.

History

1.0.1

  • Add the missing BWIPP files.

1.0.0

  • Use $PATH to find gs binary.

  • Rename PostscriptError to TreepoemError.

  • Add basic setup.py.

  • Setup Travis CI build.

  • Setup Tox

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

treepoem-1.0.1.tar.gz (298.3 kB view hashes)

Uploaded Source

Built Distribution

treepoem-1.0.1-py2.py3-none-any.whl (299.9 kB view hashes)

Uploaded Python 2 Python 3

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