python-escpos


Namepython-escpos JSON
Version 3.1 PyPI version JSON
download
home_pagehttps://github.com/python-escpos/python-escpos
SummaryPython library to manipulate ESC/POS Printers
upload_time2023-12-17 22:06:03
maintainerPatrick Kanzler
docs_urlNone
authorpython-escpos developers
requires_python>=3.8
licenseMIT
keywords esc/pos thermoprinter voucher printer printing receipt
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            #############################################################
python-escpos - Python library to manipulate ESC/POS Printers
#############################################################

Description
===========

.. image:: https://readthedocs.org/projects/python-escpos/badge/?version=latest
    :target: https://python-escpos.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

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-command-set 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 <https://github.com/receipt-print-hq/escpos-printer-db>`_ which is also used in
`escpos-php <https://github.com/mike42/escpos-php>`_.

Dependencies
------------

This library makes use of:

* `pyusb <https://github.com/walac/pyusb>`_ for USB-printers
* `Pillow <https://github.com/python-pillow/Pillow>`_ for image printing
* `qrcode <https://github.com/lincolnloop/python-qrcode>`_ for the generation of QR-codes
* `pyserial <https://github.com/pyserial/pyserial>`_ for serial printers
* `python-barcode <https://github.com/WhyNotHugo/python-barcode>`_ for the generation of barcodes

Documentation and Usage
-----------------------

The basic usage is:

.. code:: python

    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('4006381333931', 'EAN13', 64, 2, '', '')
    p.cut()


Another example based on the Network printer class:

.. code:: python

    from escpos.printer import Network

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

Another example based on the Serial printer class:

.. code:: python

    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 <https://python-escpos.readthedocs.io>`_.

Contributing
------------

This project is open for any contribution! Please see
`CONTRIBUTING.rst <https://python-escpos.readthedocs.io/en/latest/dev/contributing.html>`_
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.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/python-escpos/python-escpos",
    "name": "python-escpos",
    "maintainer": "Patrick Kanzler",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "dev@pkanzler.de",
    "keywords": "ESC/POS,thermoprinter,voucher printer,printing,receipt",
    "author": "python-escpos developers",
    "author_email": "dev@pkanzler.de",
    "download_url": "https://files.pythonhosted.org/packages/b5/e8/dbcaca6c9db8d133e3a2fc36982f20bb0bdc9bdc9e04a540b231dd75b2d1/python-escpos-3.1.tar.gz",
    "platform": "any",
    "description": "#############################################################\npython-escpos - Python library to manipulate ESC/POS Printers\n#############################################################\n\nDescription\n===========\n\n.. image:: https://readthedocs.org/projects/python-escpos/badge/?version=latest\n    :target: https://python-escpos.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\nPython ESC/POS is a library which lets the user have access to all those printers handled\nby ESC/POS commands, as defined by Epson, from a Python application.\n\nThe library tries to implement the functions provided by the ESC/POS-command-set and supports sending text, images,\nbarcodes and qr-codes to the printer.\n\nText can be aligned/justified and fonts can be changed by size, type and weight.\n\nAlso, this module handles some hardware functionalities like cutting paper, control characters, printer reset\nand similar functions.\n\nSince supported commands differ from printer to printer the software tries to automatically apply the right\nsettings for the printer that you set. These settings are handled by\n`escpos-printer-db <https://github.com/receipt-print-hq/escpos-printer-db>`_ which is also used in\n`escpos-php <https://github.com/mike42/escpos-php>`_.\n\nDependencies\n------------\n\nThis library makes use of:\n\n* `pyusb <https://github.com/walac/pyusb>`_ for USB-printers\n* `Pillow <https://github.com/python-pillow/Pillow>`_ for image printing\n* `qrcode <https://github.com/lincolnloop/python-qrcode>`_ for the generation of QR-codes\n* `pyserial <https://github.com/pyserial/pyserial>`_ for serial printers\n* `python-barcode <https://github.com/WhyNotHugo/python-barcode>`_ for the generation of barcodes\n\nDocumentation and Usage\n-----------------------\n\nThe basic usage is:\n\n.. code:: python\n\n    from escpos.printer import Usb\n\n    \"\"\" Seiko Epson Corp. Receipt Printer (EPSON TM-T88III) \"\"\"\n    p = Usb(0x04b8, 0x0202, 0, profile=\"TM-T88III\")\n    p.text(\"Hello World\\n\")\n    p.image(\"logo.gif\")\n    p.barcode('4006381333931', 'EAN13', 64, 2, '', '')\n    p.cut()\n\n\nAnother example based on the Network printer class:\n\n.. code:: python\n\n    from escpos.printer import Network\n\n    kitchen = Network(\"192.168.1.100\") #Printer IP Address\n    kitchen.text(\"Hello World\\n\")\n    kitchen.barcode('4006381333931', 'EAN13', 64, 2, '', '')\n    kitchen.cut()\n\nAnother example based on the Serial printer class:\n\n.. code:: python\n\n    from escpos.printer import Serial\n\n    \"\"\" 9600 Baud, 8N1, Flow Control Enabled \"\"\"\n    p = Serial(devfile='/dev/tty.usbserial',\n               baudrate=9600,\n               bytesize=8,\n               parity='N',\n               stopbits=1,\n               timeout=1.00,\n               dsrdtr=True)\n\n    p.text(\"Hello World\\n\")\n    p.qr(\"You can readme from your smartphone\")\n    p.cut()\n\n\nThe full project-documentation is available on\n`Read the Docs <https://python-escpos.readthedocs.io>`_.\n\nContributing\n------------\n\nThis project is open for any contribution! Please see\n`CONTRIBUTING.rst <https://python-escpos.readthedocs.io/en/latest/dev/contributing.html>`_\nfor more information.\n\n\nDisclaimer\n----------\n\nNone of the vendors cited in this project agree or endorse any of the\npatterns or implementations.\nIts names are used only to maintain context.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library to manipulate ESC/POS Printers",
    "version": "3.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/python-escpos/python-escpos/issues",
        "Documentation": "https://python-escpos.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/python-escpos/python-escpos",
        "Release Notes": "https://github.com/python-escpos/python-escpos/releases"
    },
    "split_keywords": [
        "esc/pos",
        "thermoprinter",
        "voucher printer",
        "printing",
        "receipt"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "885edef5f834b900d98c4c6477469b4e0cd1147d7158ddffcddac6904ec53f6e",
                "md5": "6243ed1bc28497d8407fa64d7967ce12",
                "sha256": "d9aec8c50b106ca83aaf0781e2bd38a02c82ab206cb6d673241db5252438c73e"
            },
            "downloads": -1,
            "filename": "python_escpos-3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6243ed1bc28497d8407fa64d7967ce12",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 69350,
            "upload_time": "2023-12-17T22:06:01",
            "upload_time_iso_8601": "2023-12-17T22:06:01.048332Z",
            "url": "https://files.pythonhosted.org/packages/88/5e/def5f834b900d98c4c6477469b4e0cd1147d7158ddffcddac6904ec53f6e/python_escpos-3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b5e8dbcaca6c9db8d133e3a2fc36982f20bb0bdc9bdc9e04a540b231dd75b2d1",
                "md5": "58982df4d6837037cb7e995d01811127",
                "sha256": "31240cdd43a6d3371c2c536f8dec02f31bf68ee967cd2edb255a94cf67295ac0"
            },
            "downloads": -1,
            "filename": "python-escpos-3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "58982df4d6837037cb7e995d01811127",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 199540,
            "upload_time": "2023-12-17T22:06:03",
            "upload_time_iso_8601": "2023-12-17T22:06:03.643394Z",
            "url": "https://files.pythonhosted.org/packages/b5/e8/dbcaca6c9db8d133e3a2fc36982f20bb0bdc9bdc9e04a540b231dd75b2d1/python-escpos-3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-17 22:06:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "python-escpos",
    "github_project": "python-escpos",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "python-escpos"
}
        
Elapsed time: 0.14960s