Skip to content

About

Zero-dependency Python 3 CLI generating batch Zebra ZPL II thermal shipping & Amazon FNSKU Code 128 labels from CSVs, GS1/UPC/EAN check digits, and local ZPL linting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zpl-barcode-cli

A zero-dependency Python 3 CLI (zpl_batch.py) for warehouse engineers, 3PL operators, and FBA sellers to generate batch Zebra ZPL II thermal shipping & Amazon FNSKU Code 128 labels from CSVs, compute/validate UPC-A / EAN-13 / GS1 Modulo-10 check digits, and statically lint raw .zpl files locally before sending jobs to thermal printers.

Need an instant browser-local ZPL previewer, bulk barcode PDF sheet maker, or Amazon FNSKU label generator with zero uploads? Try LabelBatch (https://labelbatch.hanzilla.co) — 100% browser-local barcode & thermal label suite:

What It Does

  • Batch Zebra ZPL II Label Generation (generate):
    • fnsku — Amazon FBA FNSKU Code 128 (^BCN) thermal labels (default 2.25×1.25", 203 or 300 DPI) with wrapped 2-line titles, condition, SKU, and ^PQ print quantities.
    • shipping — 4×6 thermal carrier & GS1-128 (>8 FNC1 SSCC-18) shipping labels with FROM/SHIP TO blocks, divider rules (^GB), service banner, weight, and tracking barcode.
    • product — Retail product labels auto-selecting UPC-A (^BUN), EAN-13 (^BEN), or Code 128 (^BCN), auto-computing or validating GS1 check digits.
    • Safe ^FH\ hex escaping for CSV text containing ZPL control characters (^, ~, \), plus --split-dir to write one .zpl file per row.
  • GS1 Check-Digit Calculator & Validator (checkdigit):
    • Computes and validates standard GS1 Modulo-10 check digits for UPC-A, EAN-13, EAN-8, GTIN-14, and SSCC-18 in Markdown or JSON.
  • Local ZPL II Static Linter (lint):
    • Catches real warehouse label defects before wasting rolls: unclosed ^XA/^XZ, nested ^XA, unclosed ^FD missing ^FS, ~SD darkness out of 0–30, invalid ^PQ, out-of-bounds ^FOx,y coordinates exceeding ^PW/^LL, and invalid UPC-A / EAN-13 check digits inside ^FD payloads.

Quick Usage

# Generate a batch of 2.25x1.25" Amazon FNSKU ZPL labels at 203 DPI
python3 zpl_batch.py generate samples/amazon_fnsku_batch.csv \
  --template fnsku --dpi 203 --output fnsku_batch.zpl

# Generate 4x6 thermal shipping labels (or split into one .zpl per order)
python3 zpl_batch.py generate samples/shipping_labels_4x6.csv \
  --template shipping --dpi 203 --output shipping_batch.zpl

# Compute & validate GS1 / UPC-A / EAN-13 / SSCC-18 check digits
python3 zpl_batch.py checkdigit 03600029145 4006381333931 001234560000000018

# Lint a raw .zpl file locally (exits 0 on pass, 1 on errors; add --strict for warnings)
python3 zpl_batch.py lint samples/sample_shipping.zpl
python3 zpl_batch.py lint samples/sample_shipping.zpl --format json

Sample ZPL Lint Output

# ZPL II Lint Report — PASS

- **Source:** `samples/sample_shipping.zpl` | **Labels:** 2 | **DPI:** 203
- **Errors:** 0 | **Warnings:** 0

| Label # | Size (dots) | Size (in) | Qty | Barcodes |
| ---: | --- | --- | ---: | --- |
| 1 | 812×1218 | 4.0×6.0" | 1 | Code 128: `>800001234560000000018` |
| 2 | 812×1218 | 4.0×6.0" | 2 | Code 128: `>800001234560000000025` |

No ZPL syntax, coordinate, or barcode check-digit issues detected.

Running Tests

python3 -m unittest

License

MIT — see LICENSE.

About

Zero-dependency Python 3 CLI generating batch Zebra ZPL II thermal shipping & Amazon FNSKU Code 128 labels from CSVs, GS1/UPC/EAN check digits, and local ZPL linting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages