purrint Documentation
purrint is an independent, clean-room Python library and command-line interface for communicating directly with Bluetooth Low Energy thermal printers (commonly marketed as pocket or cat printers: MX10, MX06, GB01-style, MXW01, and over 100 compatible hardware variants).
It operates locally over standard BLE channels without vendor apps, user accounts, proprietary drivers, or cloud services.
Technical Specifications
| Parameter | Specification |
|---|---|
| Supported Operating Systems | Windows 10/11, Linux (BlueZ 5.55+), macOS |
| Python Compatibility | Python 3.9, 3.10, 3.11, 3.12, 3.13 |
| Standard Paper Width | 57 mm (2.24 inches) |
| Effective Print Width | 384 dots (48 mm) |
| Thermal Resolution | 203 DPI (8 dots per mm) |
| Bluetooth Layer | Bluetooth Low Energy (GATT / Bleak) |
| Recognized Hardware Models | 107 models across V5G and V5X protocol families |
Core Architecture
The library is structured into distinct, modular layers:
- Protocol Layer (
purrint.protocol): Pure, I/O-free binary frame encoders, decoders, and CRC-8 calculation. - Driver Layer (
purrint.drivers): Protocol-specific drivers for V5G (per-line packet streaming) and V5X (block-buffered transmission and 16-level grayscale). - Transport Layer (
purrint.transport): Low-level BLE GATT connection management, service discovery, flow control, and notify handlers. - Imaging Pipeline (
purrint.imaging): EXIF correction, aspect ratio scaling, tone adjustments, 6 dithering algorithms, and 1-bit / 4-bit packing. - High-Level API (
purrint.Printer): Asynchronous and synchronous interfaces for printing, paper feeding, hardware telemetry, and job synchronization.
Installation
Install the package via pip:
To include QR code generation support, install with the qr extra: