skillfed

serialx

Serial library with native sync and async support for Windows, Linux, macOS, and other platforms

serialx v1.8.2 155.1K downloads/30d#10,831 on PyPI29
Permissive license Apache-2.0 Active released

What it is and what it does

Serialx is a cross-platform serial communication library that unifies synchronous and asynchronous APIs for Python on Linux, macOS, and Windows. It offers multiple usage patterns: a familiar synchronous context-manager interface, a native async equivalent, asyncio StreamReader/StreamWriter pairs, and low-level protocol transports for advanced consumers. The library handles modem pin state queries and control, and integrates with ESPHome for communicating with remote serial devices through the ESPHome API.

The package targets developers who need reliable serial I/O without platform-specific code paths. Its three runtime dependencies (typing-extensions, async-timeout, pywin32) are lightweight and widely maintained. The library is actively maintained with recent releases and no known security vulnerabilities.

Use it for:

  • Building cross-platform embedded device communication tools that work identically on Windows, macOS, and Linux without conditional imports.
  • Integrating ESPHome-exposed serial devices into Python applications via the serialx ESPHome transport layer.
  • Migrating legacy pyserial code to async/await patterns while maintaining synchronous fallback support.
  • Implementing protocol handlers that need low-level asyncio transport control for serial devices.
  • Controlling modem pins (RTS, DTR) on serial devices for handshake and reset sequences.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Serialx provides synchronous and native asynchronous APIs for serial port communication across Linux, macOS, and Windows, with support for modem pin control and ESPHome device integration.

Yes. Serialx is actively maintained, has no security vulnerabilities, low install friction, and offers a modern dual sync/async API for serial communication across all major platforms. It is suitable for new projects and for migrating from older serial libraries. The permissive Apache-2.0 license poses no restrictions.

Install

serialx on PyPI

pip

pip install serialx

uv

uv add serialx

poetry

poetry add serialx

Installing serialx

Before you install

Low install friction with a pure-wheel distribution. Active maintenance with a recent release 63 days ago. Requires Python 3.10 or later and depends on typing-extensions, async-timeout, and pywin32 (Windows-specific).

License in practice

Licensed under Apache-2.0 (permissive), allowing use in both open-source and proprietary projects with minimal restrictions beyond attribution and liability disclaimers.

Quickstart

import serialx

with serialx.serial_for_url("/dev/serial/by-id/port", baudrate=115200) as serial:
    data = serial.readexactly(5)
    serial.write(b"test")

Requires Python 3.10 or later; on macOS and Windows, a Rust toolchain is needed to build the native serial port enumeration extension.

Verify before relying

  • Whether the Rust toolchain requirement applies to end-users installing from wheels or only to developers building from source.
  • Performance characteristics and throughput limits compared to other serial libraries in common use.
  • Stability and maturity level given the package's first release was in 2025-11-24.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — typing-extensions, async-timeout, pywin32
Maintenance actively maintained — 63 days since the last release
Last repo commit
First released
Downloads 155,142/month — #10,831 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: serialx-1.8.2-py3-none-any.whl

Tags

serial port communication pythonasync serial librarycross-platform serial iosynchronous async serial apimodem pin controlesphome serial proxyserial device enumeration
serial-ioasync-firstcross-platform

More Networking packages