• Stars
    star
    486
  • Rank 90,527 (Top 2 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created almost 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python package for the raster language protocol of the Brother QL series label printers (QL-500, QL-550, QL-560, QL-570, QL-700, QL-710W, QL-720NW, QL-800, QL-810W, QL-820NWB, QL-1050, QL-1060N and more).

brother_ql

A Python package to control Brother QL label printers. It implements the raster language of those printers and allows you to send instruction files to your printer. In more details, the following is possible with this package:

  • Create raster language files for the Brother label printers. They can be created from image files or programmatically in your own Python script.
  • Print raster instruction files with your Brother label printer via different backends:
    • pyusb (works cross-platform)
    • network (works cross-platform for WiFi/Ethernet-enabled printers)
    • linux_kernel (works on Linux only; uses the /dev/usb/lp0 device handles)

The following printers are claimed to be supported (โœ“ means verified by the author or by contributors):

  • QL-500 (โœ“), QL-550 (โœ“), QL-560 (โœ“), QL-570 (โœ“), QL-580N, QL-650TD, QL-700 (โœ“), QL-710W (โœ“), QL-720NW (โœ“), QL-800 (โœ“), QL-810W (โœ“), QL-820NWB (โœ“), QL-1050 (โœ“), and QL-1060N (โœ“).

The new QL-800 series can print labels with two colors (black and red) on DK-22251 labels.

Note: If your printer has an 'Editor Lite' mode, you need to disable it if you want to print via USB. Make sure that the corresponding LED is not lit by holding the button down until it turns off.

If you're interested in printing labels using a web interface, check out brother_ql_web, which builds upon this package.

Why

The special feature of this package is that no printer driver is required for it to work. This software bypasses the whole printing system including printer drivers and directly talks to your label printer instead. This means that even though Brother doesn't offer a driver for the Raspberry Pi (running Linux on ARM) you can print nicely using this software. And even if there are drivers for your operating system, many programs have difficulties to set the page sizes and margins for the labels correctly. If you want to print with high precision (which is important for barcodes for example), you rather want to have control about every single pixel to be printed. This is where brother_ql comes into the game.

Installation

brother_ql is available on the Python Package Index to be installed with pip:

pip install --upgrade brother_ql

The upgrade flag makes sure, you get the latest version of brother_ql but also of its dependencies.

Alternatively, you can install the latest version from Github using:

pip install --upgrade https://github.com/pklaus/brother_ql/archive/master.zip

This package was mainly created for use with Python 3. The essential functionality, however, will also work with Python 2: the creation of label files.

In order to run the brother_ql command line utility, the directory it resides in needs to be in the PATH envirnoment variable. On some systems, the pip install command defaults to the --user flag resulting in the utility being put in the ~/.local/bin directory. On those systems, extending the path variable via export PATH="${PATH}:~/.local/bin" is needed.

Usage

The main user interface of this package is the command line tool brother_ql.

Usage: brother_ql [OPTIONS] COMMAND [ARGS]...

  Command line interface for the brother_ql Python package.

Options:
  -b, --backend [pyusb|network|linux_kernel]
  -m, --model [QL-500|QL-550|QL-560|QL-570|QL-580N|QL-650TD|QL-700|QL-710W|QL-720NW|QL-800|QL-810W|QL-820NWB|QL-1050|QL-1060N]
  -p, --printer PRINTER_IDENTIFIER
                                  The identifier for the printer. This could
                                  be a string like tcp://192.168.1.21:9100 for
                                  a networked printer or
                                  usb://0x04f9:0x2015/000M6Z401370 for a
                                  printer connected via USB.
  --debug
  --version                       Show the version and exit.
  --help                          Show this message and exit.

Commands:
  analyze   interpret a binary file containing raster...
  discover  find connected label printers
  info      list available labels, models etc.
  print     Print a label
  send      send an instruction file to the printer

There are some global options available such as --model and --printer. They can also be provided by environment variables (BROTHER_QL_MODEL and BROTHER_QL_PRINTER).

The global options are followed by a command such as info or print. The most important command is the print command and here is its CLI signature:

Usage: brother_ql print [OPTIONS] IMAGE [IMAGE] ...

  Print a label of the provided IMAGE.

Options:
  -l, --label [12|29|38|50|54|62|102|17x54|17x87|23x23|29x42|29x90|39x90|39x48|52x29|62x29|62x100|102x51|102x152|d12|d24|d58]
                                  The label (size, type - die-cut or endless).
                                  Run `brother_ql info labels` for a full
                                  list including ideal pixel dimensions.
  -r, --rotate [auto|0|90|180|270]
                                  Rotate the image (counterclock-wise) by this
                                  amount of degrees.
  -t, --threshold FLOAT           The threshold value (in percent) to
                                  discriminate between black and white pixels.
  -d, --dither                    Enable dithering when converting the image
                                  to b/w. If set, --threshold is meaningless.
  -c, --compress                  Enable compression (if available with the
                                  model). Label creation can take slightly
                                  longer but the resulting instruction size is
                                  normally considerably smaller.
  --red                           Create a label to be printed on
                                  black/red/white tape (only with QL-8xx
                                  series on DK-22251 labels). You must use
                                  this option when printing on black/red tape,
                                  even when not printing red.
  --600dpi                        Print with 600x300 dpi available on some
                                  models. Provide your image as 600x600 dpi;
                                  perpendicular to the feeding the image will
                                  be resized to 300dpi.
  --lq                            Print with low quality (faster). Default is
                                  high quality.
  --no-cut                        Don't cut the tape after printing the label.
  --help                          Show this message and exit.

So, printing an image file onto 62mm endless tape on a QL-710W label printer can be as easy as:

export BROTHER_QL_PRINTER=tcp://192.168.1.21
export BROTHER_QL_MODEL=QL-710W
brother_ql print -l 62 my_image.png

The available label names can be listed with brother_ql info labels:

 Name      Printable px   Description
 12         106           12mm endless
 29         306           29mm endless
 38         413           38mm endless
 50         554           50mm endless
 54         590           54mm endless
 62         696           62mm endless
 102       1164           102mm endless
 17x54      165 x  566    17mm x 54mm die-cut
 17x87      165 x  956    17mm x 87mm die-cut
 23x23      202 x  202    23mm x 23mm die-cut
 29x42      306 x  425    29mm x 42mm die-cut
 29x90      306 x  991    29mm x 90mm die-cut
 39x90      413 x  991    38mm x 90mm die-cut
 39x48      425 x  495    39mm x 48mm die-cut
 52x29      578 x  271    52mm x 29mm die-cut
 62x29      696 x  271    62mm x 29mm die-cut
 62x100     696 x 1109    62mm x 100mm die-cut
 102x51    1164 x  526    102mm x 51mm die-cut
 102x152   1164 x 1660    102mm x 153mm die-cut
 d12         94 x   94    12mm round die-cut
 d24        236 x  236    24mm round die-cut
 d58        618 x  618    58mm round die-cut

Pro Tipโ„ข: For the best results, use image files with the matching pixel dimensions. Die-cut labels have to be in the exact pixel dimensions stated above. For endless label rolls, you can provide image files with a pixel width as stated above. If you provide a file with different dimensions when creating an endless label file, it will be scaled to fit the width.

Backends

There are multiple backends for connecting to the printer available (โœ”: supported, โœ˜: not supported):

Backend Kind Linux Mac OS Windows
network (1) TCP โœ” โœ” โœ”
linux_kernel USB โœ” (2) โœ˜ โœ˜
pyusb (3) USB โœ” (3.1) โœ” (3.2) โœ” (3.3)

Notes:

  1. The network backend doesn't support reading back the printer state, currently. Failure such as wrong label type or end of label roll reached won't be detected by this software.
  2. The label printer should show up automatically as /dev/usb/lp0 when connected. Please check the ownership (user, group) of this file to be able to print as a regular user. Consider setting up a udev .rules file.
  3. PyUSB is a Python wrapper allowing to implement USB communication in userspace.
    1. On Linux: install libusb1 as offered by your distribution: sudo apt-get install libusb-1.0-0 (Ubuntu, Debian), sudo zyppe in libusb-1_0-0 (OpenSUSE), sudo pacman -S libusb (Arch).
    2. On Mac OS: Install Homebrew and then install libusb1 using: brew install libusb.
    3. On Windows: download libusb-win32-devel-filter-1.2.6.0.exe from sourceforge and install it. After installing, you have to use the "Filter Wizard" to setup a "device filter" for the label printer.

Legacy command line tools

For a long time, this project provided multiple command line tools, such as brother_ql_create, brother_ql_print, brother_ql_analyze, and more. The overview of those tools can still be found in the LEGACY documentation. The use of these tools is now considered deprecated and they will be removed in a future release.

Author

This software package was written by Philipp Klaus based on Brother's documentation of its raster language and based on additinal reverse engineering efforts.

Many more have contributed by raising issues, helping to solve them, improving the code and helping out financially.

Contributing

There are many ways to support the development of brother_ql:

  • File an issue on Github, if you encounter problems, have a proposal, etc.
  • Send an email with ideas to the author.
  • Submit a pull request on Github if you improved the code and know how to use git.
  • Finance a label printer from the author's wishlist to allow him to extend the device coverage and testing.
  • Donate an arbitrary amount of money for the development of brother_ql via Paypal.

Thanks to everyone helping to improve brother_ql.

Links

  • The source code and issue tracker of this package is to be found on Github: pklaus/brother_ql.
  • The package is also to be found on the Python Package Index PyPI: brother_ql.
  • A curated list of related and unrelated software can be found in this document.

More Repositories

1

brother_ql_web

A Python-based web service to print labels on Brother QL label printers. Based on brother_ql: https://github.com/pklaus/brother_ql
Python
196
star
2

ds1054z

Python package for the Rigol DS1054Z Oscilloscope
Python
170
star
3

wsgi-request-logger

A WSGI HTTP-Request Logger
Python
47
star
4

smrt

Python package to control TP-Link Easy Smart switches (version 1.0)
Python
42
star
5

timetable

A LaTeX package for creating one-week timetables as they can frequently be found in universities or schools.
TeX
37
star
6

ut61e_python

Captures and Interprets Data from the Digital Multimeter Uni-T UT61E using Python
Python
25
star
7

jpnevulator.py

An implementation of jpnevulator in Python
Python
21
star
8

label_api

A web service offering an API to print labels on Brother's QL-series. You can write your own plugin to add a new label style.
Python
18
star
9

WhatsMyIP

This is an HTTP Server that simply returns the Remote Address, your IP. In other words, it's a simple text-only "What's My IP" service implemented in a few lines of Python. Works for IPv4 and IPv6.
Python
17
star
10

netio230a

Python software to access the Koukaam NETIO-230A and NETIO-230B: power distribution units / controllable power outlets with Ethernet interface.
Python
16
star
11

docker-epics-directory

A directory of my EPICS-related Docker containers
15
star
12

python-inwx-xmlrpc

This is a python class for easy access to the InterNetworX XML-RPC API.
Python
15
star
13

Huawei-Router_Python

Python tool to fetch data from the Huawei E3372 HiLink LTE Stick or the E5332 UMTS hotspot via their XML APIs.
Python
11
star
14

geocaching-tools

Beej's GPS stuff - Geocaching (and other) tools
Python
10
star
15

python-sipgate-xmlrpc

Easy to use Python bindings for the Sipgate XML-RPC API.
Python
9
star
16

Silhouette-Cutting-Plotters

A toolkit to handle handle / analyze the format of Silhouette cutting plotters. And example data files.
Python
9
star
17

rpi-usbtmc-gateway

Using the Raspberry Pi as a USBTMC โŸท Ethernet Gateway
C
9
star
18

pt100_python

Python package with different calculation algorithms for Pt100 temperature sensors.
Python
8
star
19

brother_ql_web_docker

Dockerfiles for brother_ql_web deployments
Shell
8
star
20

TP-Link_TL-SG3210_CLI

A collection of expect scripts to communicate with the Gigabit Switch TP-Link TL-SG3210 using its Telnet interface.
Perl
8
star
21

mac_click2dial_sipgate

A plugin to call contacts via Sipgate directly from the Mac OS X Address Book. Tested with 10.6 Snow Leopard and 10.7 Lion.
Python
7
star
22

Netgear-AirCard

Check the status of a Netgear AirCard router with Python3
Python
7
star
23

ut61e-web

A web interface for the display of a UNI-T UT61E digital multimeter.
Python
7
star
24

Arduino-Logger

A logger for temperatures using NTCs, for the output of other RS232 devices and more.
Arduino
7
star
25

IntranetSubNetwork

IntranetSubNetwork โ€“ A plugin for Piwik that allows you to analyze what IPv4 and IPv6 networks your visitors come from. You may want to switch to the fork kwasib/IntranetSubNetwork with Support for Piwik 2.x.
PHP
7
star
26

labelweb

LabelWeb - Web interface to print labels for you.
JavaScript
7
star
27

PhotoBrowser

PhotoBrowser lets you browse images organized in folders on your computer in your web browser. I use it for a fast and easy image selection process. It is written in Python.
Python
6
star
28

MaxiGauge

A tool written in Python to log data from a Pfeiffer MaxiGauge Vacuum Gauge controller. Includes a Web Server to display the pressure history on the web.
JavaScript
6
star
29

sendmail_python

Send E-Mails with Python
Python
6
star
30

IP-Logger

Do you want to know which IPs your computers had during the day / the week / the year? You may use this Python Tool!
Python
6
star
31

ping_histo

A Python wrapper for ping helping you to create histograms of the ping times.
Python
6
star
32

docker-epics

Dockerfiles for my EPICS Base and contApps Docker images
Jinja
6
star
33

geant4_docker

Geant4 in a Docker Container (including Python bindings)
Dockerfile
6
star
34

docker-archiver-appliance

Docker Image of the EPICS Archiver Appliance
Python
6
star
35

CheatSheets

Cheat Sheets are simplistic help documents that can provide great support when dealing with programming or markup languages. This is a collection of Cheat Sheets written in Markdown for easy writing and embedding on websites.
Python
6
star
36

python-spelling-alphabet

If you're looking for support to spell words, names, e-mail addresses etc. this tool is for you: It helps you to spell words in different spelling alphabets like NATO, French, German (add your own). It's written in Python.
Python
6
star
37

bottlelog

Apache-like combined logging for Bottle Web Applications
Python
5
star
38

brother-ql710w

Arch Linux PKGBUILD for the Label Printer Brother QL-710W
Shell
5
star
39

medialysis

Media file analysis: power (dB) in audio files, movements in video files etc.
Python
5
star
40

agilent_34411a

Python Package for the table-top DMM Agilent 34411A using TCP/IP
Python
5
star
41

canoremote

Remote control your Canon EOS 200D, 800D and many more via BLE with this async python code.
Python
5
star
42

cropMultipleScannedImages

one scanned page with multiple images โ†’ crop images automatically (using python and edge detection)
Python
5
star
43

rs_rtb2000

Control Rohde & Schwarz RTB2000 Series DSOs with Python (R&S RTB2002, R&S RTB2004)
Python
5
star
44

opus20

Python Interface to Lufft OPUS20 devices
Python
4
star
45

FAZ-paperboy

FAZ-paperboy delivers (downloads) your FAZ or F.A.S. newspaper freshly every day as PDF.
4
star
46

pklaus

mono-repo with collected Python efforts
Python
4
star
47

PyOscilloskop

This software can control the Rigol DS1000 / DS2000 series oscilloscopes and the Rigol function generator DG1022.
Python
4
star
48

avrnetio

A Python Library to facilitate the use of ECMD commands via TCP (or RS232) for micro controller based devices that run the ethersex firmware (such as the Pollin AVR-NET-IO ).
Python
4
star
49

jinja2-render

A Python Tool to Simplify the Automated Creation of a Dockerfile Using Jinja2 Templates
Python
4
star
50

IEEE754-Viewer

A PyGTK GUI to visualise single and double precision IEEE754 floating points
Python
4
star
51

universal_usbtmc

Universal Python Interface For Different USBTMC Backends.
Python
4
star
52

serialman

A Python package facilitating the use of PySerial.
Python
3
star
53

docker-deployments

Sources for some of my docker images on:
Shell
3
star
54

Leybold-Vacuum-Gauges

A Python Interface to Oerlikon Leybold Vacuum Gauges via RS232 (currently ITR90 and ITR200 supported).
Python
3
star
55

python-piusvplus

Pi USV+ Monitoring in Python
Python
3
star
56

MAX6955

An Arduino Library for the LED Display Driver IC MAX6955
C
3
star
57

local-blog

Serves blog posts written in Markdown with bottle.py and Twitter/Bootstrap.
Python
3
star
58

python-colorscale

A toolkit to convert false color images to their original gray scale image.
Python
3
star
59

openwrt-vdsl-router

My Personal OpenWrt VDSL Router Configuration and Deployment Repository
Vim Snippet
3
star
60

bsch

Software related to Bosch Professional tools.
Python
3
star
61

obs-multi-hotkey-image

Python
2
star
62

pygments-markdown-highlighter

Pygments code highlighter for Markdown formatted posts in Wordpress
PHP
2
star
63

pytrbnet

A Python package wrapping libtrbnet.so
Python
2
star
64

Tagesspiegel-paperboy

Tagesspiegel-paperboy delivers your Tagesspiegel newspaper freshly every day.
2
star
65

mdpython

A web interface for the status output of /proc/mdstat.
Python
2
star
66

Marantz-SR5009

Controlling the 7.1 channel 4k-Receiver Marantz SR5009 (via EIA-232 or TCP)
Python
2
star
67

Gossen-U180C

Software to acquire and analyze data from the Gossen Metrawatt U180C LAN Interface for the U189A energy counter.
Python
2
star
68

Luftdruck-Hessen

Scrape official air pressure values in Hesse published by the Hessian Agency for the Environment and Geology, called HLUG.
Python
2
star
69

Widgets

Online Widgets for you! Currently it contains a widget to create QR Codes faster than ever.
2
star
70

usleep-binary

A simple usleep binary (to use in bash scripts for example)
C
2
star
71

docker-beauty

Docker Distribution of BEAUTY, the EPICS CS-Studio RDB Archive Engine
PLpgSQL
2
star
72

Kochen-und-Backen

2
star
73

beautyacc

Python package to access the EPICS RDB Archiver
Python
2
star
74

bottle-shortener

A tiny URL shortener written using Bottle and running on Python 3.3+
Python
2
star
75

Locus_Live-Tracking_BottlePy

This is a slim bottle based web app to collect position information from the Android app Locus Map Pro.
JavaScript
2
star
76

MightyWatt_Python

A Python package with a web interface for the MightyWatt, a great programmable electronic load for the Arduino Uno/Due.
Python
2
star
77

archiver-appliance-with-example-ioc

A deployment of my Docker image of the EPICS Archiver Appliance with an example IOC and a Redis DB for persistence
2
star
78

docker-phoebus-alarm

alarm-server and alarm-logger for CS-Studio Phoebus
Dockerfile
2
star
79

docker-cassandra-pv-archiver

Docker image of the Cassandra PV Archiver
Dockerfile
2
star
80

docker-phoebus-archiver

Dockerfiles for the Phoebus archive-engine Service (formerly the CSS RDB Archiver / BEAUTY)
Dockerfile
2
star
81

docker-phoebus

Docker image for CS-Studio Phoebus
Dockerfile
2
star
82

cbmroot_docker

Dockerfiles for CbmRoot (& FairRoot & FairSoft)
Dockerfile
2
star
83

HMC-8043

Python Interface for the R&S HMC 8043 power supply
Python
2
star
84

assert_epics_value_updates

Python
1
star
85

homeassistant_components

My custom homeassistant components
Python
1
star
86

FOCUS-paperboy

FOCUS-paperboy delivers your FOCUS e-magazine freshly every week.
1
star
87

network-scanner

Scans your network and stores the scan result in a structured way.
Python
1
star
88

esp8266_software

ESP8266 Software
Lua
1
star
89

trbnettools_docker

Dockerfiles to embed the TrbNetTools (including the RPC daemon trbnetd) in a Docker container
Shell
1
star
90

nautilus

Dockerfile
1
star
91

pklaus.github.com

Just a proxy website for my other projects.
JavaScript
1
star
92

epics_dash

Web Dashboard for Process Variables of an EPICS-based Control System
HTML
1
star
93

backup-wordpress-blog

A Tool to easily backup Wordpress posts to your local filesystem.
Python
1
star
94

happybuf

Happy APpendable PYthon BUFfers
Python
1
star
95

js-Unicode-Selector

A javascript based helper to access frequent unicode symbols.
1
star
96

caproto_ioc_examples

Python
1
star
97

boxplot

Tools to create boxplots of time series data.
Python
1
star
98

vacuum_reference_curves

Python
1
star
99

fboxaha

Fritz!BOX HTTP AHA SmartHome Access from Python
Python
1
star
100

2d-materialbudget

Tools to evaluate the material budget of particle detectors in 2D
Python
1
star