Skip to content

v0.1.1 — Initial release

Choose a tag to compare

@GraysonBellamy GraysonBellamy released this 16 Apr 18:04
· 24 commits to main since this release
v0.1.1
b433bfc

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 / WriteFile on asyncio Proactor, readinto_overlapped / write_overlapped on 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-state Capability model so you can ask a backend what it actually supports.
  • Runtime reconfiguration with port.configure(new_config) — serialized, atomic-on-failure (port.config never goes stale).
  • Kernel RS-485 on Linux via TIOCSRS485, with read-modify-write that preserves driver-reserved bits.
  • First-class port discoverylist_serial_ports() / find_serial_port(...) with native sysfs (Linux), IOKit (macOS), SetupAPI (Windows), and optional pyudev / pyserial backends.
  • Hardware-free testing. anyserial.testing ships a MockBackend, FaultPlan, and serial_port_pair so your tests don''t need a loopback cable.
  • Sync wrapper (anyserial.sync.SerialPort) backed by a shared BlockingPortalProvider for the "I just need to talk to a device from a script" case.

Docs

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.