Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.pyc
*.pyo

*.swp
*.swn
*.swo

pyxmlescpos.egg-info/
13 changes: 0 additions & 13 deletions DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

XML-ESC/POS
===========

Expand Down Expand Up @@ -31,15 +30,3 @@ example is self-explanatory:
from xmlescpos.printer import Usb
printer = Usb(0x04b8,0x0e03)
printer.receipt("<div>Hello World!</div>")

Limitations
-----------
The utf8 support is incomplete, mostly asian languages
are not working since they are badly documented and
only supported by region-specific hardware.

This is also the very first release, which is a simple
extraction from the Odoo code base. While it works well,
it needs some cleanup for public use.

Also, the doc is non-existent.
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

XML-ESC/POS is a simple python library that allows you to
print receipts on ESC/POS Compatible receipt printers with a simple utf8
encoded XML format similar to HTML. Barcode, pictures,
text encoding are automatically handled. No more dicking
encoded XML format similar to HTML. No more dicking
around with esc-pos commands !

The following example is self-explanatory:
Expand All @@ -28,23 +27,30 @@ The following example is self-explanatory:
<cut />
</receipt>

And printing from python is quite easy, you just
need the USB product / vendor id of your printer.
Some common ids are found in `supported_devices.py`

from xmlescpos.printer import Usb
printer = Usb(0x04b8,0x0e03)
printer.receipt("<div>Hello World!</div>")
It uses python-escpos internally. So to print it, you'd do:

## Install
from escpos import printer
from xmlescpos import Layout
epson = printer.Dummy() # Or directly to USB, Serial, Network

Layout(xml).format(epson)


## Ideas for future support:

sudo pip install pyxmlescpos
- Make the <line> tag much more powerful; support text wrapping in
the columns; different styles on each side.

- Support borders.

- Be closer to real HTML, i.e. have a <div> tag. <line> could
have an auto-ratio mode, and become flexbox.

## Install

## Limitations
sudo pip install git+https://github.com/miracle2k/[email protected]

The utf8 support is incomplete, mostly asian languages
are not working. Documentation is hard to find, support relies on region-specific hardware, etc. There is some very basic
support for Japanese.

# Documentation
## XML Structure
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/development.html#single-sourcing-the-version
version='0.1.0',
version='0.2.0',

description='Print XML-defined Receipts on ESC/POS Receipt Printers',
long_description=long_description,
Expand Down Expand Up @@ -66,7 +66,7 @@
# project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/technical.html#install-requires-vs-requirements-files
install_requires=['pyusb'],
install_requires=['python-escpos', 'six'],

# List additional groups of dependencies here (e.g. development dependencies).
# You can install these using the following syntax, for example:
Expand Down
59 changes: 0 additions & 59 deletions test_printer.py

This file was deleted.

2 changes: 1 addition & 1 deletion xmlescpos/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__all__ = ["constants","escpos","exceptions","printer","supported_devices"]
from .layout import Layout
189 changes: 0 additions & 189 deletions xmlescpos/constants.py

This file was deleted.

Loading