{"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,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","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,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}