Skip to main content

Deterministic Pillow-based renderer for Zebra EPL2 labels (ZD410 / 203 DPI) with QR, Code 128, UPC-A, and EAN-13 support.

Project description

labelscope

PyPI License Python

Python SDK and CLI for previewing Zebra EPL2 thermal labels as deterministic 1-bit PNGs — no physical printer required. Built on Pillow, targets the Zebra ZD410 at 203 DPI, with an architecture ready for ZPL / TSPL.

Status

0.1.0 MVP. Supports EPL2 text, Code 128 (forced subset B), UPC-A, EAN-13, and QR. Snapshot tests lock the renderer byte-for-byte.

Install

pip install labelscope            # core (text only)
pip install "labelscope[barcodes]" # adds treepoem / Ghostscript for barcodes

Quick start

from pathlib import Path

from labelscope import render

img = render(Path("examples/epl1-55x34.txt").read_bytes())
img.save("epl1.png", optimize=True, compress_level=9)

Examples

Render a committed fixture via the Renderer class:

from pathlib import Path

from labelscope import Renderer

renderer = Renderer(dpi=203)
img = renderer.render_file(Path("examples/epl1-55x34.txt"))
img.save("my_label.png", optimize=True, compress_level=9)

Render from an in-memory EPL2 string (useful when generating labels in your app):

from labelscope import Renderer

source = (
    "N\n"
    "q430\n"
    "Q270,24\n"
    'A22,8,0,3,1,1,N,"Hello labelscope"\n'
    'B52,60,0,1B,2,2,40,N,"SKU-00042"\n'
    "P1,1\n"
)
Renderer().render(source).save("hello.png", optimize=True, compress_level=9)

CLI, against the bundled fixtures:

labelscope render examples/epl1-55x34.txt -o preview.png
labelscope validate examples/epl2-55x34.txt
labelscope info examples/epl3-55x34.txt

Supported fixtures

Real-world labels committed under examples/ (size is width_mm x height_mm):

  • epl1-55x34.txt — Alpaca garment tag: text + Code 128 + QR.
  • epl2-55x34.txt — Multi-line garment tag with tri-color copy.
  • epl3-55x34.txt — Yarn 6-pack tag with enlarged Code 128.
  • epl4-55x44.txt — Rotated (portrait) garment tag with QR.
  • epl5-38x25.txt — Compact ZB (bottom-fed) label, narrow web.
  • epl6-38x25.txt — Compact ZB variant with short Code 128 payload.
  • epl7-38x25.txt — Text-only compact ZB label.

CLI

labelscope render examples/epl1-55x34.txt -o epl1.png --dpi 203
labelscope validate examples/epl1-55x34.txt
labelscope info examples/epl1-55x34.txt
labelscope render examples/epl2-55x34.txt --show

Supported EPL2 commands

  • Setup: N, R, q, Q, S, D, ZT, ZB, P
  • Text: A (fonts 1–5, rotations 0/1/2/3, multipliers, reverse video)
  • 1D barcodes: B (Code 128 subset B forced via BWIPP ^104, UPC-A, EAN-13)
  • 2D barcodes: b (QR: Model 1/2, ECC L/M/Q/H, magnification)

Full command reference: docs/epl2-reference.md. Project spec: contexto.md.

License

Apache 2.0. © 2026 Xpertik. Bundled DejaVu Sans Mono ships under its own permissive license — see labelscope/core/_fonts/DejaVuSansMono-LICENSE.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

labelscope-0.1.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

labelscope-0.1.0-py3-none-any.whl (233.2 kB view details)

Uploaded Python 3

File details

Details for the file labelscope-0.1.0.tar.gz.

File metadata

  • Download URL: labelscope-0.1.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for labelscope-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c65fc818e9d4d7324c2de04bdd6b2f28550e955838baba6f225fb2712d166752
MD5 9ad521b2339a68be94ff20eb9d209f07
BLAKE2b-256 2e427992ada6ccf3ea2f8ce479bf16943615ebbaa4e3ff3dcc3fb1782d0e49bc

See more details on using hashes here.

File details

Details for the file labelscope-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: labelscope-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 233.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for labelscope-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 881de3a05da18003d942cf33533af59bd15d11f2094a748cf52ed5986b845c5c
MD5 a29d12ff27f02f523aef12109a15f1c9
BLAKE2b-256 a056c08a4e437c6010b4fe9112474a5d44968e055e0facb3d8d904af85f19523

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page