v0.1.1 — Initial release
anyserial 0.1.1
Hello, and welcome to the first public release of anyserial — a low-latency, async-native serial I/O library for Python, built on AnyIO.
If you have ever reached for pyserial + threads and wished for cancellation that actually works, zero-copy reads on Windows, and a typed, AnyIO-native API that runs on asyncio or Trio without code changes — this is for you.
Install
pip install anyserial
Optional extras: anyserial[uvloop] (Linux/macOS), anyserial[winloop] (Windows), anyserial[trio], anyserial[discovery-pyudev], anyserial[discovery-pyserial].
Highlights
- Native async on every platform. Linux uses nonblocking fds with
wait_readable/wait_writable; macOS and BSD same. Windows dispatches straight through IOCP —ReadFileInto/WriteFileon asyncio Proactor,readinto_overlapped/write_overlappedon Trio. No worker threads, no fallbacks. - Works on asyncio and Trio via AnyIO. One codebase, your choice of runtime.
- Typed, immutable config.
SerialConfig.with_changes(...),FlowControl,RS485Config, and a tri-stateCapabilitymodel so you can ask a backend what it actually supports. - Runtime reconfiguration with
port.configure(new_config)— serialized, atomic-on-failure (port.confignever goes stale). - Kernel RS-485 on Linux via
TIOCSRS485, with read-modify-write that preserves driver-reserved bits. - First-class port discovery —
list_serial_ports()/find_serial_port(...)with native sysfs (Linux), IOKit (macOS), SetupAPI (Windows), and optionalpyudev/pyserialbackends. - Hardware-free testing.
anyserial.testingships aMockBackend,FaultPlan, andserial_port_pairso your tests don''t need a loopback cable. - Sync wrapper (
anyserial.sync.SerialPort) backed by a sharedBlockingPortalProviderfor the "I just need to talk to a device from a script" case.
Docs
- Full documentation: https://graysonbellamy.github.io/anyserial/
- Quickstart, configuration, RS-485, discovery, hardware testing, per-platform tuning, migration from pySerial — all in there.
Requirements
- Python 3.13+
- AnyIO 4.13+
What''s next
Issues and PRs welcome at https://github.com/GraysonBellamy/anyserial/issues. Hardware reports from exotic USB-serial adapters especially appreciated.
See the full changelog for the exhaustive per-platform feature list.