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 (requireszeroconf)--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 debugPNG + BINfiles (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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pybrother-0.1.2.tar.gz | 14.7 kB | Without provenance | Details for pybrother-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pybrother-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for pybrother-0.1.2-py3-none-any.whl |
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
|
Security for pybrother 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.