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.2.1

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.2.1
File Size Uploaded
anyio_serial-0.2.1.tar.gz 4.0 kB Details

Built distribution (wheel)

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

Total release size: 8.1 kB

Release files / anyio_serial-0.2.1.tar.gz

Download URL anyio_serial-0.2.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e55ab1e00d35076bd901021a7a3eacb4267d6c3606b31996f54e8cf039fb8003
BLAKE2b-256 checksum
How to use checksums
a8ce7d6e2fb5b51ee39d2502bc158265cb243a206d92dfcb50031f7232929faf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/65.5.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.10.9

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

Download URL anyio_serial-0.2.1-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5c3dbb8096463678930e7709ad194536e7849cd0f561b55bb04fc9a44c5329c
BLAKE2b-256 checksum
How to use checksums
dca0b0eb56b53a63b82900173de9af6822a51810d222191571e3bd7e4b81c9f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/65.5.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.10.9

Release history Release notifications | RSS feed

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

This release

0.2.1 This release

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