Elaphe
Elaphe is a python binding for the Barcode Writer In Pure PostScript (http://www.terryburton.co.uk/barcodewriter/). It is a thin-wrapper which employs Python Imaging Library as PostScript rendering interface.
Requirements
- Python 2.5 or later (functional decorators, ternary operator, and
generator expressions are used).
- If you want to render the generated barcode, Python Imaging Library
(http://www.pythonware.com/products/pil) is required under the condition that EpsImagePlugin is enabled (i.e. at least you must have Ghostscript is installed and callable from PIL).
Simple Usage
Caution! API will be changed in 0.6.
The following example:
>>> from elaphe import barcode
>>> barcode('qrcode',
... 'Hello Barcode Writer In Pure PostScript.',
... options=dict(version=9, eclevel='M'),
... margin=10, data_mode='8bits')) # Generates PIL.EpsImageFile instance
<PIL.EpsImagePlugin.EpsImageFile instance at ...>
>>> _.show() # Show the imageshould invoke default viewer which shows a QRcode symbol with 10px margin.
Remember, barcode() returns PIL image object.