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 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.
It should support more or less everything that is supported by BWIPP, but these types are specifically verified in the tests:
qrcode
- QR Codeazteccode
- Aztec Codepdf417
- PDF417interleaved2of5
- Interleaved 2 of 5code128
- Code 128code39
- Code 39
>>> 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.
Barcode - Treepoem.
Bark ode.
Tree poem.