Barcode rendering for Python 2 and 3 supporting QRcode, Aztec, PDF417, I25, Code128, Code39 and many more types.
Project description
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:
qrcode - QR Code
azteccode - Aztec Code
pdf417 - PDF417
interleaved2of5 - Interleaved 2 of 5
code128 - Code 128
code39 - Code 39
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
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 Distribution
Hashes for treepoem-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6806862d5695970f9be9701e90058dc714630116962caeedd96215b0f35c0e7 |
|
MD5 | 376e43881a9c0262bc94cc8edb9e23b0 |
|
BLAKE2b-256 | da37df95940f2e9918bfebb1ffd8f26b3aa31ba3ec53c8a56d6a9e7a0cfefffb |