Skip to main content

Simple label designer API and web API for Brother QL label printers

Project description

brother_ql_web

This is a web service to print labels on Brother QL label printers. While it is primarily focused on the API/GUI part, the corresponding functionality is provided as a library as well.

You need Python 3 for this software to work.

Screenshot

The web interface is responsive. There is also a screenshot showing how it looks on a smartphone

Installation

The easiest way to use this package is to install it from PyPI:

pip install brother_ql_web

Alternatively, you can use brother_ql_web without installing it, straight out of an unpacked source tarball or a VCS checkout.

It is also possible to install it from source for the current interpreter with:

pip install .

In addition to the Python package requirements itself, fontconfig should be installed on your system. It is used to identify and inspect fonts on your machine. This package is pre-installed on many Linux distributions. If you are using a Mac, you might want to use Homebrew to install fontconfig using brew install fontconfig.

If you are not able to install or use fontconfig for some reasons, fontra is available as a fallback. You can install if using the fontra extra.

Configuration file

Grab a copy of the example configuration file and adjust it to your needs. You can store this file on your device wherever you want - just make sure to remember the full path as you will have to pass it to the CLI.

Some special notes about the values:

  • Setting the log level to DEBUG will enable the debug mode of bottle as well. Additionally, this avoids sending the commands to the printer itself. You most likely do not want to use the DEBUG level unless you know what you are doing.

Startup

To start the server, either run brother_ql_web (only works if installed) or python -m brother_ql_web. You will always have to pass the path to your configuration file to use and the string descriptor of the printer.

The most basic call will look like this:

python -m brother_ql_web --configuration $HOME/printers/brother_ql_web/configuration_dev.json file:///dev/usb/lp0

Additional parameters might be passed and will overwrite the values configured in your configuration file. Please refer to the --help flag to learn more about the possible flags you might pass.

Usage

Once it is running, access the web interface by opening the page with your browser.

If you run it on your local machine, go to http://localhost:8013 (You can change the default port 8013 using the --port argument). You will then be forwarded by default to the interactive web GUI located at /labeldesigner.

All in all, the web server offers:

  • a web GUI allowing you to print your labels at /labeldesigner,
  • an API at /api/print/text?text=Your_Text&font_size=100&font_family=Minion%20Pro%20(%20Semibold%20) to print a label containing 'Your Text' with the specified font properties.
  • an API at /api/print/image to print a label image passed through the image file value.

About this fork

This repository contains my personal fork of the original repository.

At the moment, there is no real activity in the upstream project, with the last change happening in January 2020. In the meantime, some dependencies got outdated and Pillow deprecated and dropped some methods which break the whole application.

Additionally, I think that it makes more sense to let everyone install this package from PyPI and pass a configuration file parameter to it for customization instead of basically hardcoding the configuration file path to config.json in the current application directory.

At the moment there are no plans to submit any pull request to the upstream repository.

Differences from upstream

  • Package requires Python ≥ 3.9.
  • Migrate to a package-based structure.
  • Ensure compatibility with latest dependency versions.
  • Upgrade Bootstrap and drop jQuery as Bootstrap does not rely on it anymore.
  • Conform to PEP8 coding style.
  • Add some more printing options, like the number of labels to print for a session.
  • Add support for printing images directly.
  • Provide fallback for fontconfig.

License

This software is published under the terms of the GPLv3, see the LICENSE file in the repository.

Parts of this package are redistributed software products from 3rd parties. They are subject to different licenses:

  • Bootstrap v5.3.3, MIT License
  • Bootstrap Icons v1.11.3, MIT License
    • The CSS files received some minor modification to allow the font files to be loaded from the parent directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brother_ql_web-0.4.0.tar.gz (574.1 kB view details)

Uploaded Source

Built Distribution

brother_ql_web-0.4.0-py3-none-any.whl (547.6 kB view details)

Uploaded Python 3

File details

Details for the file brother_ql_web-0.4.0.tar.gz.

File metadata

  • Download URL: brother_ql_web-0.4.0.tar.gz
  • Upload date:
  • Size: 574.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for brother_ql_web-0.4.0.tar.gz
Algorithm Hash digest
SHA256 697cd54c7c1a752398f321bdeaf6eaabe5e86663f8246d52ecd35a9d4e3e6242
MD5 5cf8a60f0bf6dc8db59aa749ae570021
BLAKE2b-256 ff3c96238b05dff61b6bdaf96942c6036fb3a3678d4e1e165b7becbe64840d40

See more details on using hashes here.

File details

Details for the file brother_ql_web-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for brother_ql_web-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13cac98a0ef9f1c1cfb78185b11347d63e1539bd93e7c9e2d81bb4079084bd2d
MD5 fb83f65514d3ad7f899b3828f750a06d
BLAKE2b-256 2dfd7d3ef5cf76ce769aecf3f482b57ce9a5ef389243f9f1a078a9ab5ce0a3ed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page