Skip to main content

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

Metadata

Release files for pybrother 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybrother 0.1.2
File Size Uploaded
pybrother-0.1.2.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pybrother 0.1.2
File Interpreter ABI Platform
pybrother-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 29.1 kB

Release files / pybrother-0.1.2.tar.gz

Download URL pybrother-0.1.2.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ecfb0ca810cb260b57d9985956051c9451b979bdcc8d69650c02fc1a91db364f
BLAKE2b-256 checksum
How to use checksums
e060061b3e9c5cfd95ab0a0360a1dc684e5cd607bfec9abc4b20f4ec2d036ce2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / pybrother-0.1.2-py3-none-any.whl

Download URL pybrother-0.1.2-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67429b82c9b8bed76c8aa98542174f40034958dfcbfe12bf4cfffc9b1aef7fc7
BLAKE2b-256 checksum
How to use checksums
d877f9f5e0906a8bae97f0173122f6975fe210030a5b5b9ba768c9a4b62f9a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page