Quick and dirty serial bytestreams for anyio
Project description
A small Python wrapper that combines anyio and pySerial.
Implementation detail: This library is using too many short-lived threads. Yes this should be improved.
Quick start
A simple serial port reader
anyio_serial is a reasonably intuitive mash-up of pySerial and anyio’s Stream:
import anyio from anyio_serial import Serial async def main(): async with Serial(port='COM1') as port: while True: print((await port.receive()).decode(errors='ignore'), end='', flush=True) anyio.run(main)
API
anyio_serial’s interface is really simple:
from anyio_serial import Serial async with Serial(...) as port: # same options as serial.Serial ... # use "port" like any other anyio ByteStream
Attributes
The states of the serial status lines cd, cts, dsr and ri are supported.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
anyio_serial-0.2.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for anyio_serial-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94d2ca9e26bbda8d650aaacc1d69a6f8c117f447bde32425fd0ec74e025023cf |
|
MD5 | ebc5ea4120460635355c03fc47d77e7d |
|
BLAKE2b-256 | 27a5e0a28e0bcc6e2be05cac706861965cbb55c8ef2359886a83e7cb19a30772 |