skillfed

treepoem

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

treepoem v3.28.0 1.1M downloads/30d#4,366 on PyPI164
Permissive license MIT Active released

What it is and what it does

Treepoem is a Python barcode renderer that wraps the BWIPP (Barcode Writer in Pure PostScript) library and the Ghostscript command-line tool to generate barcode images. It returns barcodes as image objects, making them easy to manipulate or save. The package supports approximately 100 barcode types including QR codes, Aztec codes, PDF417, Code128, Code39, and Interleaved 2 of 5, each configurable via BWIPP options.

The package is designed for developers who need to generate barcodes programmatically in Python applications. It provides both a Python API (the `generate_barcode()` function) and a command-line interface. The main constraint is that Ghostscript must be installed separately on your system; the package itself has only one runtime dependency (pillow) and supports Python 3.9 to 3.14. There is a known rendering issue with certain Ghostscript versions (9.22+), though Ghostscript 9.26 and later generally work.

Use it for:

  • Generate QR codes for URLs or contact information in web applications or documents.
  • Create product barcodes (Code128, Code39) for inventory or point-of-sale systems.
  • Batch-generate multiple barcode types with different error-correction levels or options.
  • Embed barcodes in reports or documents by saving generated images to files.
  • Build command-line tools to generate barcodes from the shell without writing Python code.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates barcodes and QR codes as image objects by wrapping the BWIPP library and Ghostscript, supporting QR codes, Aztec, PDF417, Code128, Code39, and many other barcode types.

Yes, if you need to generate barcodes in Python and can install Ghostscript on your system. The package is actively maintained, has low Python-level install friction, and supports a wide range of barcode types. The main gotcha is the external Ghostscript dependency and known rendering quirks with older Ghostscript versions—verify compatibility with your target Ghostscript version before deploying.

Install

treepoem on PyPI

pip

pip install treepoem

uv

uv add treepoem

poetry

poetry add treepoem

Installing treepoem

Before you install

Low install friction with a single runtime dependency (pillow). Active maintenance with recent commits; however, requires Ghostscript to be installed separately on the system—a system-level dependency that must be handled outside pip.

License in practice

MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects.

Quickstart

import treepoem

image = treepoem.generate_barcode(
    barcode_type="qrcode",
    data="https://example.com",
)
image.save("barcode.png")

Ghostscript must be installed on the system (e.g., apt-get install ghostscript on Ubuntu/Debian, brew install ghostscript on macOS). Ghostscript 9.26+ recommended to avoid rendering issues.

Verify before relying

  • Whether the known smearing issue with Ghostscript 9.22+ affects your specific barcode types or use case.
  • Performance characteristics when generating large batches of barcodes.
  • Full range of image manipulation options available through the returned image object.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — pillow
Maintenance actively maintained — 339 days since the last release
Last repo commit
First released
Downloads 1,103,710/month — #4,366 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: treepoem-3.28.0-py3-none-any.whl

Keywords: barcode, bwipp, postscript, ghostscript, qr, qrcode, aztec, azteccode, pdf417, interleaved2of5, i25, code128, code39

Development Status :: 3 - AlphaIntended Audience :: DevelopersNatural Language :: EnglishProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Typing :: Typed

Tags

barcode generation pythonqr code generatorpython barcode rendererbwipp wrapperaztec code generatorpdf417 barcodecode128 code39
barcode-generationqr-codeimage-rendering

More Graphics packages