Metadata-Version: 2.1
Name: labelprinterkit
Version: 0.5.2
Summary: A library for creating and printing labels for Brother P-Touch devices
License: Apache License, Version 2.0
Author: Adrian Tschira
Author-email: packages@notafile.com
Requires-Python: >=3.10,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Provides-Extra: bluetooth
Provides-Extra: qrcode
Requires-Dist: packbits (>=0.6,<0.7)
Requires-Dist: pillow (>=9.5.0,<10.0.0)
Requires-Dist: pyserial (>=3.5,<4.0) ; extra == "bluetooth"
Requires-Dist: pyusb (>=1.2.1,<2.0.0)
Requires-Dist: qrcode[pil] (>=7.4.2,<8.0.0) ; extra == "qrcode"
Description-Content-Type: text/markdown

### Labelprinterkit

Labelprinterkit is a Python3 library for creating and printing labels with
Brother P-Touch devices. It was developed for the Networking department of
KIT (Karlsruhe Institute of Technology).

Labelprinterkit's simple layout engine can be used to create simple labels:

```python
from labelprinterkit.backends.usb import PyUSBBackend
from labelprinterkit.printers import P700
from labelprinterkit.label import Label, Text, Box, Padding
from labelprinterkit.job import Job
from labelprinterkit.constants import MediaType, MediaSize
from labelprinterkit.page import Page
from PIL import Image

# Create text for the label

text1 = Text(45, "First line", 'comic.ttf', padding=Padding(0, 0, 1, 0))
text2 = Text(25, "Some text", 'comic.ttf')
text3 = Text(25, "Other text", 'comic.ttf')

# Insert Text into boxes
box1 = Box(45, text1)
box2 = Box(25, text2, text3)

# Create label with rows from above
label = Label(box1, box2)

# Create job with configuration and add label as page
job = Job(MediaSize.W12, MediaType.LAMINATED_TAPE)
job.add_page(label)

# Create a page from a Pillow image and add it to the job
image = Image.new("1", (70, 200), "white")
page = Page.from_image(image)
job.add_page(page)

# scan for a USB printer using the PyUSBBackend
backend = PyUSBBackend()
printer = P700(backend)

# Print job
printer.print(job)
```

To use a Bluetooth connection:
1. pair your device
2. specify the serial device node when instantiating the printer:

```python
printer = GenericPrinter(BTSerialBackend(dev_path='/dev/ttyS8'))
```

The following printers are currently supported:

 * Brother P-Touch PT-700 (aka P700)
 * Brother P-Touch PT-750W (aka P750W)
 * Brother H500
 * Brother E500

The following printers have been tested to mostly work, although not
officially supported (their protocol is similar, although not identical):

* Brother P-touch CUBE Plus PTP710BT

The following backends are currently supported:

 * USB Printer Device Class via PyUSB
 * Bluetooth Serial connection via PySerial
 * Network connection via TCP

The official source of this repository is at https://git.scc.kit.edu/scc-net/labelprinterkit.
Pull requests and issues are also accepted on github at https://github.com/ogelpre/labelprinterkit.

