{"id":24393,"library":"pyserial-asyncio-fast","title":"pyserial-asyncio-fast","description":"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).","status":"active","version":"0.16","language":"python","source_language":"en","source_url":"https://github.com/gfedike/pyserial-asyncio-fast","tags":["serial","asyncio","serial-port","async"],"install":[{"cmd":"pip install pyserial-asyncio-fast","lang":"bash","label":"Default installation"}],"dependencies":[{"reason":"Core serial port library","package":"pyserial","optional":false}],"imports":[{"note":"Wrong package: pyserial-asyncio (old) vs pyserial-asyncio-fast","wrong":"from serial_asyncio import SerialTransport","symbol":"SerialTransport","correct":"import serial_asyncio_fast as s; s.SerialTransport"},{"note":"Wrong package: pyserial-asyncio (old) vs pyserial-asyncio-fast","wrong":"from serial_asyncio import create_serial_connection","symbol":"create_serial_connection","correct":"from serial_asyncio_fast import create_serial_connection"}],"quickstart":{"code":"import asyncio\nimport serial_asyncio_fast\n\nasync def main():\n    reader, writer = await serial_asyncio_fast.open_serial_connection(url='/dev/ttyUSB0', baudrate=115200)\n    writer.write(b'hello')\n    data = await reader.read(100)\n    print(data)\n    writer.close()\n\nasyncio.run(main())","lang":"python","description":"Open a serial connection and read/write asynchronously."},"warnings":[{"fix":"pip install pyserial-asyncio-fast and change imports from 'serial_asyncio' to 'serial_asyncio_fast'.","message":"pyserial-asyncio (original) is deprecated. Use pyserial-asyncio-fast (faster, maintained).","severity":"deprecated","affected_versions":"pyserial-asyncio all versions"},{"fix":"Always call writer.close() after use, ideally in a try/finally block.","message":"open_serial_connection returns (asyncio.StreamReader, asyncio.StreamWriter), not a custom transport. Writers must be explicitly closed.","severity":"gotcha","affected_versions":"all versions"},{"fix":"Use 'import serial_asyncio_fast' (underscores).","message":"The package uses 'serial_asyncio_fast' (with underscore), not 'serial-asyncio-fast' (hyphen). Common import error.","severity":"gotcha","affected_versions":"all versions"}],"env_vars":null,"search_vec":"'-04':32 '-09':33 '0.16':30 '2024':31 'async':17,39 'asyncio':3,6,35 'asyncio-bas':5 'base':7 'built':13 'cancel':27 'communic':21 'current':28 'fast':4 'i/o':10 'port':9,38 'provid':16 'pyseri':2,15 'pyserial-asyncio-fast':1 'python':12 'serial':8,20,34,37 'serial-port':36 'support':23 'timeout':25 'version':29 'wrapper':18","created_at":"2026-05-01T08:12:51.371823+00:00","updated_at":"2026-05-01T08:12:51.371823+00:00","problems":[{"fix":"Install pyserial-asyncio-fast and use 'import serial_asyncio_fast' (underscores).","cause":"Installed the wrong package or used the old import path.","error":"ModuleNotFoundError: No module named 'serial_asyncio'"},{"fix":"Use 'serial_asyncio_fast.open_serial_connection' instead.","cause":"Function may be named 'open_serial_connection' in this version.","error":"AttributeError: module 'serial_asyncio_fast' has no attribute 'create_serial_connection'"},{"fix":"Wrap the call in asyncio.run() or run within a running loop.","cause":"Called async function outside of an asyncio event loop.","error":"NotImplementedError: Event loop is not running"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.16","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/home-assistant-libs/pyserial-asyncio-fast","docs":"http://pyserial-asyncio.readthedocs.io","changelog":null,"pypi":"https://pypi.org/project/pyserial-asyncio-fast/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}