Skip to main content
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, Python 2.7 and 3.3+ compatible.

Installation

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.

API

generate_barcode(barcode_type, data, options)

Generates a barcode and returns it as a PIL image file object (specifically, a PIL.EpsImagePlugin.EpsImageFile).

barcode_type is the name of the barcode type to generate (see below).

data is the string of data to embed in the barcode - the amount that can be embedded varies by type.

options is a dictionary of strings-to-strings of extra options to be passed to BWIPP, as per its docs.

For example, this generates a QR code image, and saves it to a file using standard PIL Image.save():

>>> import treepoem
>>> image = treepoem.generate_barcode(
...     barcode_type='qrcode',  # One of the BWIPP supported codes.
...     data='barcode payload',
...     options={},
... )
>>> image.save('barcode.png')

barcode_types

This is a set of the ~100 names of the barcode types that the vendored version of BWIPP supports. If you’re looking for whether a specific type is supported, check here.

The library is tested with these specific, common types:

What’s so clever about the name?

Barcode.

Bark ode.

Tree poem.

History

1.3.2 (2017-10-22)

  • Upgrade BWIPP from 2017-07-10 to 2017-10-19. This has a few bug fixes. You can read its changelog in the vendored copy in the treepoem repo.

1.3.1 (2017-08-24)

  • Upgrade BWIPP from 2017-06-20 to 2017-07-10. This has a few bug fixes. You can read its changelog in the vendored copy in the treepoem repo.

1.3.0 (2017-06-21)

  • Upgrade BWIPP from 2015-11-24 to 2017-06-20. This has a number of bug fixes, and supports more barcode types. It has also changed the pixel-for-pixel output of some formats, although they still encode the same information - notably QR codes, which are tested in treepoem's test suite. You can read its changelog in the vendored copy in the treepoem repo.

1.2.0 (2017-06-21)

  • Add treepoem.barcode_types, a set of all the names of supported barcode types, and error if asked to generate a barcode of an unknown type.

1.1.0 (2017-04-13)

  • Support Windows.

1.0.1 (2016-03-30)

  • Add the missing BWIPP files.

1.0.0 (2016-03-23)

  • Use $PATH to find gs binary.

  • Rename PostscriptError to TreepoemError.

  • Add basic setup.py.

  • Setup Travis CI build.

  • Setup Tox

Release files for treepoem 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for treepoem 1.3.2
File Size Uploaded
treepoem-1.3.2.tar.gz 345.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for treepoem 1.3.2
File Interpreter ABI Platform
treepoem-1.3.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 693.3 kB

Release files / treepoem-1.3.2.tar.gz

Download URL treepoem-1.3.2.tar.gz
Size 345.9 kB
Tags Source
SHA-256 checksum
How to use checksums
67c59b0f067c0e404b52ffba105f59b0b0bf13205750da16314b1bcfc507261c
BLAKE2b-256 checksum
How to use checksums
09ebd47d1d9f4a02fab6fc414af206f99b78375fafbcfa5d93a0edf7ce727c8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / treepoem-1.3.2-py2.py3-none-any.whl

Download URL treepoem-1.3.2-py2.py3-none-any.whl
Size 347.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
540df4399b20ccd524ae700fd31f01bf65c7ab3df44ab717a703e880fb7274c0
BLAKE2b-256 checksum
How to use checksums
aa962b694ece48663350685c0dbac415dbfbf16c3ace754d0e73635ad820d339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

3.27.1

2 release files

3.27.0

2 release files

3.25.0

2 release files

3.24.0

2 release files

3.22.0

2 release files

3.21.0

2 release files

3.20.0

2 release files

3.19.0

2 release files

3.18.0

2 release files

3.17.0

2 release files

3.16.0

2 release files

3.15.0

2 release files

3.14.0

2 release files

3.13.0

2 release files

3.12.0

2 release files

3.11.0

2 release files

3.10.0

2 release files

3.9.0

2 release files

3.8.0

2 release files

3.7.0

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.4.1

1 release file

1.4.0

2 release files

This release

1.3.2 This release

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page