Registry / communication / pyserial-asyncio-fast

pyserial-asyncio-fast

JSON →
library0.16pypypi✓ verified 87d ago

Asyncio-based serial port I/O for Python, built on pyserial. Provides async wrappers for serial communication with support for timeouts and cancellation. Current version 0.16 (2024-04-09).

pip install pyserial-asyncio-fast
INSTALL
IMPORT
SIG · PYSERIAL-ASYNCIO-F
P
pyserial-asyncio-fast
communicationpythonv0.16
Install
1.6s avg
Import
213ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.16 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.218s · 18.5MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.208s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SerialTransport
✓ import serial_asyncio_fast as s; s.SerialTransport
✗ from serial_asyncio import SerialTransport
Wrong package: pyserial-asyncio (old) vs pyserial-asyncio-fast
create_serial_connection
✓ from serial_asyncio_fast import create_serial_connection
✗ from serial_asyncio import create_serial_connection
Wrong package: pyserial-asyncio (old) vs pyserial-asyncio-fast

Open a serial connection and read/write asynchronously.

import asyncio import serial_asyncio_fast async def main(): reader, writer = await serial_asyncio_fast.open_serial_connection(url='/dev/ttyUSB0', baudrate=115200) writer.write(b'hello') data = await reader.read(100) print(data) writer.close() asyncio.run(main())
Debug
Known issues
deprecatedpyserial-asyncio (original) is deprecated. Use pyserial-asyncio-fast (faster, maintained).
fix
pip install pyserial-asyncio-fast and change imports from 'serial_asyncio' to 'serial_asyncio_fast'.
affects: pyserial-asyncio all versions
gotchaopen_serial_connection returns (asyncio.StreamReader, asyncio.StreamWriter), not a custom transport. Writers must be explicitly closed.
fix
Always call writer.close() after use, ideally in a try/finally block.
affects: all versions
gotchaThe package uses 'serial_asyncio_fast' (with underscore), not 'serial-asyncio-fast' (hyphen). Common import error.
fix
Use 'import serial_asyncio_fast' (underscores).
affects: all versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'serial_asyncio'
Installed the wrong package or used the old import path.
fix
Install pyserial-asyncio-fast and use 'import serial_asyncio_fast' (underscores).
AttributeError: module 'serial_asyncio_fast' has no attribute 'create_serial_connection'
Function may be named 'open_serial_connection' in this version.
fix
Use 'serial_asyncio_fast.open_serial_connection' instead.
NotImplementedError: Event loop is not running
Called async function outside of an asyncio event loop.
fix
Wrap the call in asyncio.run() or run within a running loop.
Upgrade
Version history
0.16latest on PyPI · released Mar 27, 2025
Audit
Dependencies
pyserialrequiredCore serial port library
Agent activity
25 hits · last 30 days
node
24
OpenAI (training)
1
Resources
pyserial-asyncio-fast — pip install pyserial-asyncio-fast · libregistry