Skip to main content

Asyncio wrapper for pyserial

Project description

Asyncio wrapper for pyserial

.. image::
:alt: PyPI version

.. image::
:alt: Python Versions

.. image::
:alt: Documentation Status

`asyncserial` is a a wrapper for the `pyserial` library providing an async interface based on `async def` and `await`.


.. code-block:: sh
pip install asyncserial


.. code-block:: python

import asyncio
from asyncserial import Serial

loop = asyncio.get_event_loop()

test_serial = Serial(loop, "/dev/ttyACM0", baudrate=115200)

async def test():
await # Drop anything that was already received
while True:
line = await test_serial.readline() # Read a line
print("[+] Serial read: {}".format(line))
await asyncio.sleep(0) # Let's be a bit greedy, should be adjust to your needs


print("[+] Starting eventloop")

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asyncserial-0.1.0.tar.gz (8.0 kB view hashes)

Uploaded source

Built Distribution

asyncserial-0.1.0-py3-none-any.whl (8.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page