{ "info": { "author": "Luke Granger-Brown", "author_email": "git@lukegb.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "# ticketml [![Build Status](https://travis-ci.org/lukegb/ticketml.svg?branch=master)](https://travis-ci.org/lukegb/ticketml) [![PyPI Version](https://pypip.in/version/ticketml/badge.svg?style=flat)](https://pypi.python.org/pypi/ticketml)\nA small XML-based markup language for tickets\n\nWhy?\n====\n\nAs part of the code I write for [Imperial Cinema](http://www.imperialcinema.co.uk), I decided\nI need some way of cleanly abstracting over multiple different (but similar) ticket printers.\n\nI decided on a sort-of HTML-ish language, for which you will find a parser and ticket printing\nbackend for the following receipt printers:\n\n* Citizen CBM-1000\n* IBM 4610 family (tested on the 4610-TF6)\n\nThe XML\n=======\n\nThe XML document has the following sort of style:\n\n```xml\n\n\n \n \n not bold suddenly bold not bold again
\n not underlined suddenly underlined not underlined
\n now for a mix of settings
\n \n base font
\n 2x wide
\n 2x high
\n 2x big
\n MASSIVE\n \n
\n```\n\n(Note that this document is formatted neatly - leading per-line whitespace is NOT stripped by the parser and may cause you issues!)\n\nThe following tags are implemented - unknown tags are ignored (but are still recursed into!):\n\n* `ticket`: this is the root tag and is not treated specially\n* `b`: activates emphasis (usually bold)\n* `u`: activates underlining\n* `logo num=\"NUMBER\"`: prints pre-loaded image NUMBER\n* `align mode=\"left|right|center\"`: changes the alignment of text\n* `br`: prints a newline\n* `font (width=\"WIDTH\") (height=\"HEIGHT\")`: changes the font width/height multiplier\n\nUsing it\n========\n\nAt the moment there's a fairly simplistic API. In order to get started, you'll need some sort of file-like output device. This is usually a PySerial `Serial` object.\n\n```python\nimport serial\noutput = serial.Serial('/dev/ttyS1', 19200)\n```\n\nNow that you have an output device, you can construct a `Backend`. At present there's a choice of two, the `CbmBackend` (for Citizen CBM-1000 printers) and the `Ibm4610Backend` (for IBM 4610 series printers). Backends are up to take whatever arguments they choose - at the moment this is just the output device they should talk to.\n\n```python\nbackend = ticketml.Ibm4610Backend(output)\n```\n\nNow you can finally construct a parser. This takes place in two stages - first you parse the input XML, then you tell the parser to render it to the output device:\n\n```python\nticket = ticketml.TicketML.parse('\\nHello! This is my first ticket!')\ncontext = {}\nticket.go(context, backend)\n```\n\nThe `context` parameter is unused at the moment, but is planned to be used for future templating functionality.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lukegb/ticketml", "keywords": "ticketml", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "ticketml", "package_url": "https://pypi.org/project/ticketml/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ticketml/", "project_urls": { "Homepage": "https://github.com/lukegb/ticketml" }, "release_url": "https://pypi.org/project/ticketml/0.2.3/", "requires_dist": [ "enum34 (>=1.0.4)", "lxml (>=3.4)", "pySerial (>=2.7)" ], "requires_python": "", "summary": "TicketML is a simple markup language for receipt printers", "version": "0.2.3" }, "last_serial": 1856913, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a4698fc5c5ef273a6cf2929c484a2648", "sha256": "d73812c29b68d7edd901c5c7afd53fdbb7fe2efa3a075ae9741b5725f414fcae" }, "downloads": -1, "filename": "ticketml-0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "a4698fc5c5ef273a6cf2929c484a2648", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 9453, "upload_time": "2015-03-13T18:55:35", "url": "https://files.pythonhosted.org/packages/e5/31/acd42da9bbb1f26316a784a9e1062baf0033aaf34e6da5cb6996ea625ecc/ticketml-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "45545a41f0452e888b3bc4274f8918dd", "sha256": "78922f2d8399a4bf88ba9ad9f4a40da637bc858b340aaa45f08b1ef1b79197d6" }, "downloads": -1, "filename": "ticketml-0.1.tar.gz", "has_sig": true, "md5_digest": "45545a41f0452e888b3bc4274f8918dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7408, "upload_time": "2015-03-13T18:54:27", "url": "https://files.pythonhosted.org/packages/5a/44/771666e35b222f188340d665af46c5d723a6ba59dd62e8bd95511c1a0e51/ticketml-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "f7735bb062ec4fc3ca9e966863a65160", "sha256": "311ca00199aaa98e52c3c4bfcc173532cac6f5af362764411462cb07d975629b" }, "downloads": -1, "filename": "ticketml-0.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "f7735bb062ec4fc3ca9e966863a65160", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10074, "upload_time": "2015-12-11T01:43:12", "url": "https://files.pythonhosted.org/packages/4c/80/1fe32858c7b6c7a6cb8890653ff1f109581dcd9a429d06434660117f3e93/ticketml-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ba9d09443c9c2cae3136344dffd40b3", "sha256": "422971444325a759afa292fae2f9075cd17981fab00b7436778c4e806641cda0" }, "downloads": -1, "filename": "ticketml-0.2.tar.gz", "has_sig": true, "md5_digest": "1ba9d09443c9c2cae3136344dffd40b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7767, "upload_time": "2015-12-11T01:43:23", "url": "https://files.pythonhosted.org/packages/6d/5b/89f607de619ba1addc1e00cf61b60b25ce710c8e8b18ee607758d6b5ec58/ticketml-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "0bf303fffb7fcb3220c95b351b9ec1e2", "sha256": "332166f01b39c316094d71927d21b7634c6012427e1e7cd530375c5ac742ddba" }, "downloads": -1, "filename": "ticketml-0.2.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "0bf303fffb7fcb3220c95b351b9ec1e2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10180, "upload_time": "2015-12-11T02:06:03", "url": "https://files.pythonhosted.org/packages/87/76/c7edcff34ee7bc767e057e408467b4778d215481398490e773ea3e19b36b/ticketml-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7ff4b91bba255f6d436f936c5d0a2e85", "sha256": "e81693a754c554344bd6a61004b4015d31184b5b94da93a230684ef99fd3d68d" }, "downloads": -1, "filename": "ticketml-0.2.1.tar.gz", "has_sig": true, "md5_digest": "7ff4b91bba255f6d436f936c5d0a2e85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8046, "upload_time": "2015-12-11T02:06:12", "url": "https://files.pythonhosted.org/packages/ac/e7/d07e8ac945aeab5034e7f8184e3d4da4dabd96997ec9345faa648fbfd9ee/ticketml-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "ddde149e9aab584d8d8150bdf6d22ab8", "sha256": "5db143b62a7f628985ef96043bf9bcb035b8b7299fd4664620454addf86ed015" }, "downloads": -1, "filename": "ticketml-0.2.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "ddde149e9aab584d8d8150bdf6d22ab8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10181, "upload_time": "2015-12-11T03:10:53", "url": "https://files.pythonhosted.org/packages/a7/39/6badcebb33c371f58e76e97303dbcaf0519f947aed310eb16de401db52b7/ticketml-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7d68992d8e19a280f7851d2ee3f90e4", "sha256": "4c8b61c69459d40e4c13fdfd18e897029b849f44c0377a5000476ff0fdf2cc0f" }, "downloads": -1, "filename": "ticketml-0.2.2.tar.gz", "has_sig": true, "md5_digest": "a7d68992d8e19a280f7851d2ee3f90e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8100, "upload_time": "2015-12-11T03:11:05", "url": "https://files.pythonhosted.org/packages/17/86/1461fe8f5bc699a93b587e871103db27a61e3bb99b315f91be1e418fcb4c/ticketml-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "ff6da70e4f93c1be69933383c464cd0f", "sha256": "2ed7d578813242eb727f9c2261fec9274bdbd233aac2c66f07a6286f6e68768a" }, "downloads": -1, "filename": "ticketml-0.2.3-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "ff6da70e4f93c1be69933383c464cd0f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10186, "upload_time": "2015-12-11T03:22:57", "url": "https://files.pythonhosted.org/packages/47/ef/6ccee88e3a07850f9a06bed1c47b9565d8ba48153ea2127a3a2caad3848c/ticketml-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "adef6642fb7e658b06a8b037a8231d8d", "sha256": "98a400ef442f3c7adce26a5d24f5994e710c2d8a8131b4c21df8534e9a114626" }, "downloads": -1, "filename": "ticketml-0.2.3.tar.gz", "has_sig": true, "md5_digest": "adef6642fb7e658b06a8b037a8231d8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8162, "upload_time": "2015-12-11T03:23:01", "url": "https://files.pythonhosted.org/packages/8b/3a/400d03323654a282d9382cc9d70f0d200e76c03b3e5123559319bfa57a90/ticketml-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ff6da70e4f93c1be69933383c464cd0f", "sha256": "2ed7d578813242eb727f9c2261fec9274bdbd233aac2c66f07a6286f6e68768a" }, "downloads": -1, "filename": "ticketml-0.2.3-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "ff6da70e4f93c1be69933383c464cd0f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10186, "upload_time": "2015-12-11T03:22:57", "url": "https://files.pythonhosted.org/packages/47/ef/6ccee88e3a07850f9a06bed1c47b9565d8ba48153ea2127a3a2caad3848c/ticketml-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "adef6642fb7e658b06a8b037a8231d8d", "sha256": "98a400ef442f3c7adce26a5d24f5994e710c2d8a8131b4c21df8534e9a114626" }, "downloads": -1, "filename": "ticketml-0.2.3.tar.gz", "has_sig": true, "md5_digest": "adef6642fb7e658b06a8b037a8231d8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8162, "upload_time": "2015-12-11T03:23:01", "url": "https://files.pythonhosted.org/packages/8b/3a/400d03323654a282d9382cc9d70f0d200e76c03b3e5123559319bfa57a90/ticketml-0.2.3.tar.gz" } ] }