--- id: serialx version: "1.8.2" license: Apache-2.0 license_treatment: permissive maintenance: active --- # serialx — Serial library with native sync and async support for Windows, Linux, macOS, and other platforms License: permissive · Maintenance: active · Downloads: 155.1K/mo ## 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 above — 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 pip install serialx uv add serialx 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_current - Install friction: low - Maintenance: active - Downloads: 155.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags serial port communication python, async serial library, cross-platform serial io, synchronous async serial api, modem pin control, esphome serial proxy, serial device enumeration, serial-io, async-first, cross-platform [View on SkillFed](https://skillfed.io/packages/serialx) · [View on PyPI](https://pypi.org/project/serialx/)