python-escpos
Python library to manipulate ESC/POS Printers
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-escposuv
uv add python-escpospoetry
poetry add python-escposInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
binho-host-adapterControls Binho Multi-Protocol USB Host Adapters…
permissive · top 15,000 on PyPI
brotherQueries Brother laser and inkjet printers over…
permissive · top 15,000 on PyPI
pyippAsynchronous Python client for querying and…
permissive · top 15,000 on PyPI
zxing-cppReads and writes barcodes and QR codes in…
permissive · top 5,000 on PyPI
bellowsbellows is a Python library that implements the…
copyleft · top 15,000 on PyPI
pyserial-asyncioAdds async/await support to pyserial for…
permissive · top 15,000 on PyPI
prettyprinterSyntax-highlighted, declarative pretty printer…
permissive · top 5,000 on PyPI
esp-pylibProvides shared logging, error handling,…
permissive · top 15,000 on PyPI
pyusbPyUSB provides Python access to USB devices on…
permissive · top 5,000 on PyPI
pyprusalinkAsync Python client for the PrusaLink HTTP API,…
permissive · top 15,000 on PyPI