Skip to main content

Wrapper for Brother networked label printing commands.

Project description

python-brotherprint

Brother networked label printers library for Python

This was developed for the QL-580N but I’ve heard it also works for the following:

  • QL-720NW

Installation

The easiest way to install this package is with pip.

pip install brotherprint

Usage

This library supports two printing modes. ESC/P commands, and templates. I highly recommend using templates, because it is easier to manage, and offers more features. I will, however, go over both. You should review the official Brother documentation [here (ESCP Docs)](http://www.mediafire.com/?3wbanr34bsr18dw) and [here (Template Command Docs)](http://www.mediafire.com/?v798mue7i58ed66), to know what is available.

## Setup Regardless of which mode you are using, you need to intialize and connect a socket object, and pass the resulting socket object to the BrotherLabel object instantiator.

from brotherprint import BrotherPrint f_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) f_socket.connect((<ip_address>,<port (9100 by default for QL580N)>)) printjob = BrotherPrint(f_socket)

### ESC/P Printing Invoke escp commands through certain BrotherLabel object methods (see actual file for method descriptions) Make sure to end with the print page command, signifying the end of a label.

printjob.command_mode() printjob.initialize() printjob.bold(‘on’) printjob.send(<text>) printjob.print_page(<cut_setting>)

### Template Printing Create your template and upload it to the printer. After creating a BrotherLabel object, call template_mode() to set the printer to template mode, and then use the template commands to fill in your label.

printjob.template_mode() printjob.template_init() printjob.choose_template(<template_number>) printjob.select_and_insert(<field_name>, <data>) printjob.select_and_insert(<field_name2>, <data2>) printjob.select_and_insert(<field_name3>, <data3>) printjob.template_print()

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

brotherprint-0.1.3.tar.gz (8.1 kB view details)

Uploaded Source

File details

Details for the file brotherprint-0.1.3.tar.gz.

File metadata

  • Download URL: brotherprint-0.1.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for brotherprint-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f089674a7b8b1e888ebb65531890aaaefcbdccabfd0930a30328b6f9fca708df
MD5 32f11322212847f04614d693ae9a458c
BLAKE2b-256 8c54bcf5d50a534ec7129f07e20c66de5eed1ce08f03b2177af9a49b9da7bf1b

See more details on using hashes here.

Supported by

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