Skip to main content

Universal Brother Label Printer with PNG and labelprinterkit modes

Project description

pybrother

A Python CLI and helper library for printing labels on networked Brother P‑touch printers using their raster command set.

Quick Start

Run without installing

# Show help
uvx pybrother -- --help

# Print a label
uvx pybrother -- "Hello World" --printer 192.168.1.100

# Save PNG preview explicitly
uvx pybrother -- "Hello World" --printer 192.168.1.100 --output ~/Desktop/label.png

# Save debug artifacts (PNG + BIN) in temp directory
uvx pybrother -- "Hello World" --printer 192.168.1.100 --artifacts

uvx will download the package, create an isolated environment, and run the pybrother console entry point (an alias named brother-printer remains for compatibility).

Install from PyPI

pip install pybrother

# Then use the CLI directly
pybrother "Hello World" --printer 192.168.1.100

Command Options

The CLI supports the following useful switches:

  • text – Label text (wrap in quotes for spaces)
  • --font – Font size in dots (default: auto size per tape)
  • --tape – Tape size (W3_5, W6, W9, W12, W18, W24)
  • --margin – Left/right margin in pixels (default: 10)
  • --copies – Number of copies to print (default: 1)
  • --printer – Printer IP address (required unless discovered or from env var)
  • --listen – Passively listen for printers via mDNS (requires zeroconf)
  • --listen-timeout – Seconds to wait when listening (default: 70)
  • --no-auto-detect – Skip automatic tape detection
  • --output PATH – Save PNG preview to a specific file
  • --artifacts [DIR] – Save debug PNG + BIN files (optional target directory)

By default, pybrother renders and prints fully in memory (no PNG/BIN files are written unless requested).

Set BROTHER_PRINTER_IP to avoid providing --printer each invocation.

Development

# Install dependencies (including dev extras)
uv sync --extra dev

# Run the test suite
uv run pytest

# Build a wheel and sdist
uv run hatch build

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

pybrother-0.1.2.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

pybrother-0.1.2-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file pybrother-0.1.2.tar.gz.

File metadata

  • Download URL: pybrother-0.1.2.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for pybrother-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ecfb0ca810cb260b57d9985956051c9451b979bdcc8d69650c02fc1a91db364f
MD5 bd945c5cab118587ce332cb83ef676f1
BLAKE2b-256 e060061b3e9c5cfd95ab0a0360a1dc684e5cd607bfec9abc4b20f4ec2d036ce2

See more details on using hashes here.

File details

Details for the file pybrother-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pybrother-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for pybrother-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 67429b82c9b8bed76c8aa98542174f40034958dfcbfe12bf4cfffc9b1aef7fc7
MD5 0c9c4bb60d941363f76c574fbdcb5d2b
BLAKE2b-256 d877f9f5e0906a8bae97f0173122f6975fe210030a5b5b9ba768c9a4b62f9a08

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