Skip to main content

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.

Release files for anyio-serial 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anyio-serial 0.3.2
File Size Uploaded
anyio_serial-0.3.2.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anyio-serial 0.3.2
File Interpreter ABI Platform
anyio_serial-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / anyio_serial-0.3.2.tar.gz

Download URL anyio_serial-0.3.2.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6ccc24b717dd943d692b0cdf221081ae0d1c5e3cbe2cf456c0bebd54601b7d8e
BLAKE2b-256 checksum
How to use checksums
ec0ae6bd8b5ae39038e699f97266abc5a5099e0bb30cb43936bf34b516398250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / anyio_serial-0.3.2-py3-none-any.whl

Download URL anyio_serial-0.3.2-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
702a75b218d0536021beecc3cdecf2bdbb5c962b79af312da96b7919da4b43e2
BLAKE2b-256 checksum
How to use checksums
50c023b76d1c7c52872ee0a01a3f8948c9de7db20ab3164560029d72529525ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.13

2 release files

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.2

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page