Best practices interfacing to device with Python's asyncio and pyserial-asyncio

Malte Forkel malte.forkel at
Mon Apr 3 04:51:49 EDT 2017


I have written a Python package to read from and write to a serial
device that uses short telegrams to communicate with sensors and
actuators. My classes include one to model the transceiver (it
establishes the serial connection using
serial.aio.create_serial_connection) and one for the telegram protocol
based on asyncio.Protocol. I also have a bunch of classes for the
different types of telegrams and devices.

While this all works, the device model and the protocol don't look very
pythonic to me. Are there any tutorials or examples demonstrating best
practices of how to do something like this?


More information about the Python-list mailing list