Skip to main content

PRINT simple labels on ql700

Project description

qltool 0.2.4

Tool to print labels with Brother QL-700/QL-570 label printer

A wrapper around the excellent ql570.c by Asbjørn Sloth Tønnesen, Marc Juul and Luca Zimmermann.

Features

  • Print text labels (1-3 lines)
  • Print QR codes with text
  • Print banners (text along paper length)
  • Custom font sizes
  • MQTT client for remote printing
  • Preview before printing

Installation

Using uv (recommended):

uv pip install -e .

Or with pip:

pip3 install qltool

Usage

Standard Label Print

Print 1-3 lines of text:

# Preview only
uv run src/qltool/main.py "Line 1" "Line 2" "Line 3" --font-size 40

# Print with specific font size
uv run src/qltool/main.py "Hello World" "Second line" -p --font-size 55

QR Code Labels

# Generate and print QR code with text
uv run src/qltool/main.py "Item: 12345" "Location: Office" -q -p

# Use existing QR image
uv run src/qltool/main.py "Scan me" --qr /path/to/qrcode.png -p

Banner Mode (Text along paper length)

# Preview banner
uv run src/qltool/main.py "Long text banner" --banner --font-size 40

# Print banner
uv run src/qltool/main.py "STS Chvojkovice-Brod" --banner --font-size 40 -p

Command Options

  • -p, --print - Send to printer (without this, shows preview)
  • -q, --qr - Generate QR code
  • --qr PATH - Use existing QR image
  • --banner - Create banner (text along paper length)
  • --font-size N - Set font size (default: 72)
  • --width N - Set image width in pixels (default: 714 for 62mm tape)
  • --gray N - Gray bias 0-100 (default: 50)
  • -d, --device - Specify printer device (default: auto-detect /dev/usb/lp*)

MQTT Client

Run the MQTT client for remote printing:

qltool_client

Send print jobs via MQTT:

# Simple print
mosquitto_pub -t qltool/print -m "Hello World -p"

# With QR code
mosquitto_pub -t qltool/print -m "Inventory Item -q -p"

# Banner
mosquitto_pub -t qltool/print -m "Long banner text --banner -p"

Development

Run directly from source:

# Preview
uv run src/qltool/main.py "Test text" --font-size 40

# Print
uv run src/qltool/main.py "Test text" --font-size 40 -p

Requirements

  • Brother QL-700 or QL-570 printer
  • User must be in lp group for printer access
  • Linux with USB lp device support (/dev/usb/lp*)

Org-mode Integration (Inventory)

For Emacs org-mode table integration:

;; Add to .emacs
(defun print-inventory-item ()
  "Print current org table row as label"
  (interactive)
  ;; Your implementation here
  )

Example table format:

ID Name Owner Location
D4-12345678 Sample inventory item Pepa Home

The tool can extract ID and name fields to generate QR-coded inventory labels.

Credits

  • ql570.c driver by Asbjørn Sloth Tønnesen, Marc Juul and Luca Zimmermann
  • Built with Python, Click, Pillow, and OpenCV

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

qltool-0.2.6.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

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

qltool-0.2.6-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file qltool-0.2.6.tar.gz.

File metadata

  • Download URL: qltool-0.2.6.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.16

File hashes

Hashes for qltool-0.2.6.tar.gz
Algorithm Hash digest
SHA256 f2db6b1dae2d22a4da474f134e74816a533ff36704b79db7b8865c6eeb8cf6ca
MD5 f76d38ea9995b22dbcc315cc7bbbf6f2
BLAKE2b-256 06bb35ffe88a8eb0ee0bab9af58f6abc0626a1c6444414704a44af3cf357fcb2

See more details on using hashes here.

File details

Details for the file qltool-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: qltool-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.16

File hashes

Hashes for qltool-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 32eaf58b5758789d340d9bcb2e4237fcdb5a6c7f7ddd17853df29f189a90cd16
MD5 55b386a0414030326b8a43c6779b0413
BLAKE2b-256 09f673f250b06fda13510b19bc97c3719c4b767b3b24592925969f65da8a854e

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