{"id":13469259,"url":"https://github.com/pklaus/brother_ql","last_synced_at":"2025-05-15T17:01:50.811Z","repository":{"id":40599216,"uuid":"47879364","full_name":"pklaus/brother_ql","owner":"pklaus","description":"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).","archived":false,"fork":false,"pushed_at":"2024-06-23T21:47:03.000Z","size":182,"stargazers_count":583,"open_issues_count":95,"forks_count":178,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-03-31T21:46:23.512Z","etag":null,"topics":["brother","brother-label-printer","brother-ql","label-printer","printer","printer-driver","ql-1050","ql-500","ql-550","ql-570","ql-700","ql-710w","ql-720nw","ql-800","ql-820nwb","raster-language"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pklaus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-12T13:32:20.000Z","updated_at":"2025-03-21T05:38:01.000Z","dependencies_parsed_at":"2024-06-18T18:30:51.066Z","dependency_job_id":"2a3607ac-16a3-42b1-a518-32df887f7c63","html_url":"https://github.com/pklaus/brother_ql","commit_stats":{"total_commits":191,"total_committers":9,"mean_commits":21.22222222222222,"dds":0.1465968586387435,"last_synced_commit":"56cf4394ad750346c6b664821ccd7489ec140dae"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pklaus%2Fbrother_ql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pklaus%2Fbrother_ql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pklaus%2Fbrother_ql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pklaus%2Fbrother_ql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pklaus","download_url":"https://codeload.github.com/pklaus/brother_ql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247737787,"owners_count":20987721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brother","brother-label-printer","brother-ql","label-printer","printer","printer-driver","ql-1050","ql-500","ql-550","ql-570","ql-700","ql-710w","ql-720nw","ql-800","ql-820nwb","raster-language"],"created_at":"2024-07-31T15:01:30.997Z","updated_at":"2025-04-07T22:07:58.082Z","avatar_url":"https://github.com/pklaus.png","language":"Python","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=philipp.klaus@gmail.com\u0026lc=US\u0026item_name=Donation+to+brother_ql+Development\u0026no_note=0\u0026cn=\u0026currency_code=USD\u0026bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"],"categories":["Python"],"sub_categories":[],"readme":"## brother\\_ql\n\nA Python package to control Brother QL label printers.\nIt implements the raster language of those printers and allows you to send instruction files to your printer.\nIn more details, the following is possible with this package:\n\n* Create raster language files for the Brother label printers.\n  They can be created from image files or programmatically in your own Python script.\n* Print raster instruction files with your Brother label printer via different backends:\n    * pyusb (works cross-platform)\n    * network (works cross-platform for WiFi/Ethernet-enabled printers)\n    * linux\\_kernel (works on Linux only; uses the /dev/usb/lp0 device handles)\n\nThe following printers are claimed to be supported (✓ means verified by the author or by contributors):\n\n* QL-500 (✓), QL-550 (✓), QL-560 (✓), QL-570 (✓), QL-580N, QL-650TD, QL-700 (✓), QL-710W (✓),\n  QL-720NW (✓), QL-800 (✓), QL-810W (✓), QL-820NWB (✓), QL-1050 (✓), and QL-1060N (✓).\n\nThe new QL-800 series can print labels with two colors (black and red) on DK-22251 labels.\n\nNote: If your printer has an 'Editor Lite' mode, you need to disable it if you want to print via USB.\nMake sure that the corresponding LED is not lit by holding the button down until it turns off.\n\nIf you're interested in printing labels using a web interface, check out [brother\\_ql\\_web][],\nwhich builds upon this package.\n\n## Why\n\nThe special feature of this package is that no printer driver is required for it to work.\nThis software bypasses the whole printing system including printer drivers and directly\ntalks to your label printer instead.\nThis means that even though Brother doesn't offer a driver for the Raspberry Pi (running\nLinux on ARM) you can print nicely using this software.\nAnd even if there are drivers for your operating system, many programs have difficulties to set\nthe page sizes and margins for the labels correctly.\nIf you want to print with high precision (which is important for barcodes for example),\nyou rather want to have control about every single pixel to be printed.\nThis is where brother\\_ql comes into the game.\n\n## Installation\n\nbrother\\_ql is [available on the Python Package Index][PyPI] to be installed with pip:\n\n    pip install --upgrade brother_ql\n\nThe upgrade flag makes sure, you get the latest version of brother\\_ql but also\nof its dependencies.\n\nAlternatively, you can install the latest version from Github using:\n\n    pip install --upgrade https://github.com/pklaus/brother_ql/archive/master.zip\n\nThis package was mainly created for use with Python 3.\nThe essential functionality, however, will also work with Python 2: the creation of label files.\n\nIn order to run the `brother_ql` command line utility, the directory it resides in\nneeds to be in the PATH envirnoment variable.\nOn some systems, the `pip install` command defaults to the `--user` flag resulting in the utility\nbeing put in the `~/.local/bin` directory.\nOn those systems, extending the path variable via `export PATH=\"${PATH}:~/.local/bin\"` is needed.\n\n## Usage\n\nThe main user interface of this package is the command line tool `brother_ql`.\n\n    Usage: brother_ql [OPTIONS] COMMAND [ARGS]...\n    \n      Command line interface for the brother_ql Python package.\n    \n    Options:\n      -b, --backend [pyusb|network|linux_kernel]\n      -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]\n      -p, --printer PRINTER_IDENTIFIER\n                                      The identifier for the printer. This could\n                                      be a string like tcp://192.168.1.21:9100 for\n                                      a networked printer or\n                                      usb://0x04f9:0x2015/000M6Z401370 for a\n                                      printer connected via USB.\n      --debug\n      --version                       Show the version and exit.\n      --help                          Show this message and exit.\n    \n    Commands:\n      analyze   interpret a binary file containing raster...\n      discover  find connected label printers\n      info      list available labels, models etc.\n      print     Print a label\n      send      send an instruction file to the printer\n\nThere are some global options available such as --model and --printer.\nThey can also be provided by environment variables (`BROTHER_QL_MODEL` and `BROTHER_QL_PRINTER`).\n\nThe global options are followed by a command such as `info` or `print`.\nThe most important command is the `print` command and here is its CLI signature:\n\n    Usage: brother_ql print [OPTIONS] IMAGE [IMAGE] ...\n    \n      Print a label of the provided IMAGE.\n    \n    Options:\n      -l, --label [12|29|38|50|54|62|102|17x54|17x87|23x23|29x42|29x90|39x90|39x48|52x29|62x29|62x100|102x51|102x152|d12|d24|d58]\n                                      The label (size, type - die-cut or endless).\n                                      Run `brother_ql info labels` for a full\n                                      list including ideal pixel dimensions.\n      -r, --rotate [auto|0|90|180|270]\n                                      Rotate the image (counterclock-wise) by this\n                                      amount of degrees.\n      -t, --threshold FLOAT           The threshold value (in percent) to\n                                      discriminate between black and white pixels.\n      -d, --dither                    Enable dithering when converting the image\n                                      to b/w. If set, --threshold is meaningless.\n      -c, --compress                  Enable compression (if available with the\n                                      model). Label creation can take slightly\n                                      longer but the resulting instruction size is\n                                      normally considerably smaller.\n      --red                           Create a label to be printed on\n                                      black/red/white tape (only with QL-8xx\n                                      series on DK-22251 labels). You must use\n                                      this option when printing on black/red tape,\n                                      even when not printing red.\n      --600dpi                        Print with 600x300 dpi available on some\n                                      models. Provide your image as 600x600 dpi;\n                                      perpendicular to the feeding the image will\n                                      be resized to 300dpi.\n      --lq                            Print with low quality (faster). Default is\n                                      high quality.\n      --no-cut                        Don't cut the tape after printing the label.\n      --help                          Show this message and exit.\n\nSo, printing an image file onto 62mm endless tape on a QL-710W label printer can be as easy as:\n\n    export BROTHER_QL_PRINTER=tcp://192.168.1.21\n    export BROTHER_QL_MODEL=QL-710W\n    brother_ql print -l 62 my_image.png\n\nThe available label names can be listed with `brother_ql info labels`:\n\n     Name      Printable px   Description\n     12         106           12mm endless\n     29         306           29mm endless\n     38         413           38mm endless\n     50         554           50mm endless\n     54         590           54mm endless\n     62         696           62mm endless\n     102       1164           102mm endless\n     17x54      165 x  566    17mm x 54mm die-cut\n     17x87      165 x  956    17mm x 87mm die-cut\n     23x23      202 x  202    23mm x 23mm die-cut\n     29x42      306 x  425    29mm x 42mm die-cut\n     29x90      306 x  991    29mm x 90mm die-cut\n     39x90      413 x  991    38mm x 90mm die-cut\n     39x48      425 x  495    39mm x 48mm die-cut\n     52x29      578 x  271    52mm x 29mm die-cut\n     62x29      696 x  271    62mm x 29mm die-cut\n     62x100     696 x 1109    62mm x 100mm die-cut\n     102x51    1164 x  526    102mm x 51mm die-cut\n     102x152   1164 x 1660    102mm x 153mm die-cut\n     d12         94 x   94    12mm round die-cut\n     d24        236 x  236    24mm round die-cut\n     d58        618 x  618    58mm round die-cut\n\n**Pro Tip™**:\nFor the best results, use image files with the matching pixel dimensions.\nDie-cut labels have to be in the exact pixel dimensions stated above.\nFor endless label rolls, you can provide image files with a pixel width as stated above.\nIf you provide a file with different dimensions when creating an endless label file,\nit will be scaled to fit the width.\n\n### Backends\n\nThere are multiple backends for connecting to the printer available (✔: supported, ✘: not supported):\n\nBackend | Kind | Linux | Mac OS | Windows\n-------|-------|---------|---------|--------\nnetwork (1) | TCP | ✔ | ✔ | ✔\nlinux\\_kernel | USB | ✔ (2) | ✘ | ✘\npyusb (3) | USB | ✔ (3.1) | ✔ (3.2) | ✔ (3.3)\n\nNotes:\n\n1. The network backend doesn't support reading back the printer state, currently.\n   Failure such as *wrong label type* or *end of label roll reached* won't be detected by this software.\n2. The label printer should show up automatically as `/dev/usb/lp0` when connected.\n   Please check the ownership (user, group) of this file to be able to print as a regular user.\n   Consider setting up a udev .rules file.\n3. PyUSB is a Python wrapper allowing to implement USB communication in userspace.\n   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).\n   2. On Mac OS: Install [Homebrew](https://brew.sh/) and then install libusb1 using: `brew install libusb`.\n   3. On Windows: download [libusb-win32-devel-filter-1.2.6.0.exe](https://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.6.0/)\n      from sourceforge and install it.\n      After installing, you have to use the \"Filter Wizard\" to setup a \"device filter\" for the label printer.\n\n### Legacy command line tools\n\nFor a long time, this project provided multiple command line tools, such as\n`brother_ql_create`, `brother_ql_print`, `brother_ql_analyze`, and more.\nThe overview of those tools can still be found in the [LEGACY][] documentation.\nThe use of these tools is now considered deprecated and they will be\nremoved in a future release.\n\n## Author\n\nThis software package was written by Philipp Klaus based on Brother's documentation\nof its raster language and based on additinal reverse engineering efforts.\n\n* Philipp Klaus  \n  \u003cphilipp.l.klaus@web.de\u003e\n\nMany more have contributed by raising issues, helping to solve them,\nimproving the code and helping out financially.\n\n## Contributing\n\nThere are many ways to support the development of brother\\_ql:\n\n* **File an issue** on Github, if you encounter problems, have a proposal, etc.\n* **Send an email with ideas** to the author.\n* **Submit a pull request** on Github if you improved the code and know how to use git.\n* **Finance a label printer** from the [author's wishlist][] to allow him to extend the device coverage and testing.\n* **Donate** an arbitrary amount of money for the development of brother\\_ql [via Paypal][donation].\n\nThanks to everyone helping to improve brother\\_ql.\n\n## Links\n\n* The source code and issue tracker of this package is to be found on **Github**: [pklaus/brother\\_ql][].\n* The package is also to be found on the Python Package Index **PyPI**: [brother\\_ql][PyPI].\n* A curated list of related and unrelated software can be found [in this document][related-unrelated].\n\n[author's wishlist]: https://www.amazon.de/registry/wishlist/3GSVLPF08AFIR\n[donation]: https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=philipp.klaus@gmail.com\u0026lc=US\u0026item_name=Donation+to+brother_ql+Development\u0026no_note=0\u0026cn=\u0026currency_code=USD\u0026bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted\n[brother\\_ql\\_web]: https://github.com/pklaus/brother_ql_web\n[LEGACY]: https://github.com/pklaus/brother_ql/blob/master/LEGACY.md\n[pklaus/brother\\_ql]: https://github.com/pklaus/brother_ql\n[PyPI]: https://pypi.python.org/pypi/brother_ql\n[related-unrelated]: https://gist.github.com/pklaus/aeb55e18d36690df6a84a3eab49e9fd7\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpklaus%2Fbrother_ql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpklaus%2Fbrother_ql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpklaus%2Fbrother_ql/lists"}