skillfed

python-escpos

Python library to manipulate ESC/POS Printers

python-escpos v3.1 109.1K downloads/30d#12,528 on PyPI1,314
Permissive license MIT Active released

What it is and what it does

python-escpos is a Python wrapper around the ESC/POS command set defined by Epson, enabling applications to control thermal receipt printers commonly used in point-of-sale systems. It abstracts the low-level printer protocol, letting you send formatted text, images, barcodes, and QR codes to printers connected via USB, network, or serial interfaces. The library handles printer-specific variations automatically by consulting an external printer database to apply the correct settings for your device model.

The package depends on Pillow for image rendering, qrcode and python-barcode for code generation, and PyYAML and other utilities for configuration. It supports modern Python versions (3.8–3.12) and is actively maintained. Use it when you need to print receipts, labels, or vouchers from a Python application without manually constructing binary ESC/POS commands.

Use it for:

  • Print receipts and transaction records from a point-of-sale application to a thermal printer.
  • Generate and print barcodes or QR codes on labels or receipts for inventory or customer tracking.
  • Control paper cutting, font styles, and text alignment on thermal printers from a Python backend.
  • Integrate thermal printer output into a kitchen display or order management system.
  • Send formatted text and images to network-connected or USB-attached receipt printers in retail or hospitality settings.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python library to send text, images, barcodes, and QR codes to ESC/POS thermal printers via USB, network, or serial connections.

Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, uses a permissive MIT license, and solves a real problem for applications that need to control ESC/POS printers. It is well-suited for point-of-sale, receipt printing, and label generation tasks. The main constraint is that you must have a compatible printer and know its connection details (USB IDs, network address, or serial port).

Install

python-escpos on PyPI

pip

pip install python-escpos

uv

uv add python-escpos

poetry

poetry add python-escpos

Installing python-escpos

Before you install

Low friction install with a wheel distribution. Maintains active development (last commit 2026-08-04) and supports current Python versions (3.8–3.12). Nine runtime dependencies are all well-established libraries (Pillow, PyYAML, qrcode, python-barcode, etc.).

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

from escpos.printer import Usb
p = Usb(0x04b8, 0x0202, 0, profile="TM-T88III")
p.text("Hello World\n")
p.barcode('4006381333931', 'EAN13', 64, 2, '', '')
p.cut()

Requires a compatible ESC/POS printer connected via USB, network, or serial; printer vendor ID and product ID needed for USB connections.

Verify before relying

  • Whether pyusb and pyserial are optional or required for USB and serial printer support (not listed in runtime deps).
  • Specific printer models and firmware versions confirmed to work with the automatic profile detection system.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 9 — Pillow, PyYAML, appdirs, argcomplete, importlib-resources, python-barcode, qrcode, setuptools, six
Maintenance actively maintained — 971 days since the last release
Last repo commit
First released
Downloads 109,078/month — #12,528 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_escpos-3.1-py3-none-any.whl

Keywords: ESC/POS, thermoprinter, voucher printer, printing, receipt

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Office/Business :: Financial :: Point-Of-SaleTopic :: Software Development :: Libraries :: Python Modules

Tags

ESC/POS printer controlthermal receipt printer pythonbarcode qr code printingpoint of sale printer libraryUSB serial network printer
pos-printingthermal-printerhardware-integration

More Python Modules packages