{ "info": { "author": "Henry Chang", "author_email": "mr.changyuheng@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Programming Language :: Python :: 3.6", "Topic :: Communications", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Terminals :: Serial" ], "description": "# aioserial\n\n* [Quick start](#quick-start)\n + [A simple serial port reader](#a-simple-serial-port-reader)\n* [API](#api)\n + [AioSerial](#aioserial)\n - [Constructor](#constructor)\n - [Methods](#methods)\n * [read_async](#read-async)\n * [read_until_async](#read-until-async)\n * [readinto_async](#readinto-async)\n * [readline_async](#readline-async)\n * [readlines_async](#readlines-async)\n * [write_async](#write-async)\n * [writelines_async](#writelines-async)\n + [Other APIs](#other-apis)\n* [Why aioserial?](#why-aioserial-)\n\nA Python package that combines [asyncio](https://docs.python.org/3/library/asyncio.html) and [pySerial](https://github.com/pyserial/pyserial).\n\n## Quick start\n\n### A simple serial port reader\n\n```py\nimport aioserial\nimport asyncio\n\n\nasync def read_and_print(aioserial_instance: aioserial.AioSerial):\n while True:\n print((await aioserial_instance.read_async()).decode(errors='ignore'), end='', flush=True)\n\nasyncio.run(read_and_print(aioserial.AioSerial(port='COM1')))\n```\n\n## API\n\n### AioSerial\n\n```py\n>>> import aioserial\n>>> import serial\n\n>>> isinstance(aioserial.AioSerial(), serial.Serial)\nTrue\n\n>>> issubclass(aioserial.AioSerial, serial.Serial)\nTrue\n\n>>> aioserial.Serial is serial.Serial\nTrue\n```\n\n#### Constructor\n\n```py\naioserial_instance: aioserial.AioSerial = aioserial.AioSerial(\n # ... same with what can be passed to serial.Serial ...,\n loop: Optional[asyncio.AbstractEventLoop] = None)\n```\n\n#### Methods\n\n\n##### read_async\n\n```py\nbytes_read: bytes = \\\n await aioserial_instance.read_async(size: int = 1)\n```\n\n##### read_until_async\n\n```py\nat_most_certain_size_of_bytes_read: bytes = \\\n await aioserial_instance.read_until_async(\n expected: bytes = aioserial.LF, size: Optional[int] = None)\n```\n\n##### readinto_async\n\n```py\nnumber_of_byte_read: int = \\\n await aioserial_instance.readinto_async(b: Union[array.array, bytearray])\n```\n\n##### readline_async\n\n```py\na_line_of_at_most_certain_size_of_bytes_read: bytes = \\\n await aioserial_instance.readline_async(size: int = -1)\n```\n\n##### readlines_async\n\n```py\nlines_of_at_most_certain_size_of_bytes_read: bytes = \\\n await aioserial_instance.readlines_async(hint: int = -1)\n```\n\n##### write_async\n\n```py\nnumber_of_byte_like_data_written: int = \\\n await aioserial_instance.write_async(bytes_like_data)\n```\n\n##### writelines_async\n\n```py\nnumber_of_byte_like_data_in_the_given_list_written: int = \\\n await aioserial_instance.writelines_async(list_of_bytes_like_data)\n```\n\n### Other APIs\n\nAll the other APIs in package [pySerial](https://github.com/pyserial/pyserial) are supported in [aioserial](https://github.com/changyuheng/aioserial) as [original](https://pyserial.readthedocs.io/).\n\n## Why aioserial?\n\n* Want to use an asyncio-based but not a (self-built) thread-based serial library.\n* [pySerial-asyncio](https://github.com/pyserial/pyserial-asyncio) does [not support Windows](https://github.com/pyserial/pyserial-asyncio/issues/3).\n* APIs in all the other packages ([pySerial-asyncio](https://github.com/pyserial/pyserial-asyncio), [asyncserial](https://github.com/xvzf/asyncserial-py)) that target the same goal are not designed in high level.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/changyuheng/aioserial", "keywords": "", "license": "MPL-2.0", "maintainer": "", "maintainer_email": "", "name": "aioserial", "package_url": "https://pypi.org/project/aioserial/", "platform": "", "project_url": "https://pypi.org/project/aioserial/", "project_urls": { "Homepage": "https://github.com/changyuheng/aioserial" }, "release_url": "https://pypi.org/project/aioserial/1.1.3/", "requires_dist": null, "requires_python": ">=3.6", "summary": "An asynchronous serial port library of Python", "version": "1.1.3" }, "last_serial": 5186372, "releases": { "1.0.10": [ { "comment_text": "", "digests": { "md5": "50a337c92e71ea6f110c3a5fac1476e3", "sha256": "9916196af3e3ee6173531f2397ef0b0ca334c5c42f707ec5898790b3fa9cfca7" }, "downloads": -1, "filename": "aioserial-1.0.10.tar.gz", "has_sig": false, "md5_digest": "50a337c92e71ea6f110c3a5fac1476e3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 4508, "upload_time": "2018-10-08T17:12:28", "url": "https://files.pythonhosted.org/packages/ba/35/0990e159396a67b1da5f851ca7f542514a894429c30b2a848e4dff86c412/aioserial-1.0.10.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "5431847f5c19c066ca08d48f81ef6dd4", "sha256": "6c4421ab64b1010d3d51ef7cb096db150133ba0c52f8ae0b3a37746772dad08b" }, "downloads": -1, "filename": "aioserial-1.1.0.tar.gz", "has_sig": false, "md5_digest": "5431847f5c19c066ca08d48f81ef6dd4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4520, "upload_time": "2018-11-13T03:36:24", "url": "https://files.pythonhosted.org/packages/df/6f/7e91993bab5763c7ad07bdd0fc76e64a7a152dfa0fc26edb5397f20168ae/aioserial-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "2d42f95b5a565c96c1cb84fddcd0053b", "sha256": "7ee09ae3e274b85d5597c390da30913fbd346eeeeb289d13ebfff1e458e28e38" }, "downloads": -1, "filename": "aioserial-1.1.1.tar.gz", "has_sig": false, "md5_digest": "2d42f95b5a565c96c1cb84fddcd0053b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4503, "upload_time": "2018-11-13T06:56:57", "url": "https://files.pythonhosted.org/packages/42/21/c4d100fb803645fd670e9ddf6a13162adc92a66f38d562e15c2f3cd053fb/aioserial-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "f2bb8ea606828e3f582d70c28dde4dd9", "sha256": "e4099b264a3b3b29a82e8e4532964f29660d78ede480eb68275d4d579e7664d9" }, "downloads": -1, "filename": "aioserial-1.1.2.tar.gz", "has_sig": false, "md5_digest": "f2bb8ea606828e3f582d70c28dde4dd9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4509, "upload_time": "2019-02-19T15:04:39", "url": "https://files.pythonhosted.org/packages/43/bb/8cd2217e0d105638ed83b796b2f5d279341f7a789d1af366a3c335f6f81a/aioserial-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "ff97c75d2aed76d314e7f21726acad15", "sha256": "291357a062d537d2122cdc95fe2be2b74eaf310b385b067b70da3cf8b316ae7e" }, "downloads": -1, "filename": "aioserial-1.1.3.tar.gz", "has_sig": false, "md5_digest": "ff97c75d2aed76d314e7f21726acad15", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4721, "upload_time": "2019-04-25T06:47:17", "url": "https://files.pythonhosted.org/packages/97/55/40dcb75c1edc827e0ce9c7238862c8b9822ee6679247e7a45bfabe34b6fa/aioserial-1.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ff97c75d2aed76d314e7f21726acad15", "sha256": "291357a062d537d2122cdc95fe2be2b74eaf310b385b067b70da3cf8b316ae7e" }, "downloads": -1, "filename": "aioserial-1.1.3.tar.gz", "has_sig": false, "md5_digest": "ff97c75d2aed76d314e7f21726acad15", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4721, "upload_time": "2019-04-25T06:47:17", "url": "https://files.pythonhosted.org/packages/97/55/40dcb75c1edc827e0ce9c7238862c8b9822ee6679247e7a45bfabe34b6fa/aioserial-1.1.3.tar.gz" } ] }