Skip to main content

python-escpos - Python library to manipulate ESC/POS Printers

Continous Integration Code Coverage Documentation Status

Description

Python ESC/POS is a library which lets the user have access to all those printers handled by ESC/POS commands, as defined by Epson, from a Python application.

The library tries to implement the functions provided by the ESC/POS-commandset and supports sending text, images, barcodes and qr-codes to the printer.

Text can be aligned/justified and fonts can be changed by size, type and weight.

Also, this module handles some hardware functionalities like cutting paper, control characters, printer reset and similar functions.

Since supported commands differ from printer to printer the software tries to automatically apply the right settings for the printer that you set. These settings are handled by escpos-printer-db which is also used in escpos-php.

Dependencies

This library makes use of:

Documentation and Usage

The basic usage is:

from escpos.printer import Usb

""" Seiko Epson Corp. Receipt Printer (EPSON TM-T88III) """
p = Usb(0x04b8, 0x0202, 0, profile="TM-T88III")
p.text("Hello World\n")
p.image("logo.gif")
p.barcode('1324354657687', 'EAN13', 64, 2, '', '')
p.cut()

Another example based on the Network printer class:

from escpos.printer import Network

kitchen = Network("192.168.1.100") #Printer IP Address
kitchen.text("Hello World\n")
kitchen.barcode('1324354657687', 'EAN13', 64, 2, '', '')
kitchen.cut()

Another example based on the Serial printer class:

from escpos.printer import Serial

""" 9600 Baud, 8N1, Flow Control Enabled """
p = Serial(devfile='/dev/tty.usbserial',
           baudrate=9600,
           bytesize=8,
           parity='N',
           stopbits=1,
           timeout=1.00,
           dsrdtr=True)

p.text("Hello World\n")
p.qr("You can readme from your smartphone")
p.cut()

The full project-documentation is available on Read the Docs.

Contributing

This project is open for any contribution! Please see CONTRIBUTING.rst for more information.

Disclaimer

None of the vendors cited in this project agree or endorse any of the patterns or implementations. Its names are used only to maintain context.

Metadata

Release files for psk-escpos 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psk-escpos 1.0.8
File Size Uploaded Provenance Actions
psk-escpos-1.0.8.tar.gz 11.2 kB Without provenance Details for psk-escpos-1.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for psk-escpos 1.0.8
File Interpreter ABI Platform Actions
psk_escpos-1.0.8-py3-none-any.whl Python 3 none any Details for psk_escpos-1.0.8-py3-none-any.whl

Total release size: 78.8 kB

Release files / psk-escpos-1.0.8.tar.gz

Download URL psk-escpos-1.0.8.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
28a1a071ba2ad089bab321ddf29ac4f98c5241c8b43276ce9f58e26f56d98c9b
BLAKE2b-256 checksum
How to use checksums
cfd23a59820996ffde445a8cb580867940c45f22e602453343130483abf44b79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3

Release files / psk_escpos-1.0.8-py3-none-any.whl

Download URL psk_escpos-1.0.8-py3-none-any.whl
Size 67.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e17ff624d5740c0466963ddb3078bf79ed6842bd0f4852e9b8ba779fe0623b77
BLAKE2b-256 checksum
How to use checksums
a8b86d3f184e19c3994873d98e57fb13b05720e7e1763d46a655f2c078606acf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.3

Security for psk-escpos 1.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page