pySerial is a multiplatform, easy to useSerial Port Module for Python (supports Mac OS X, Win32, Jython, Linux, BSD and more).
NOTE: pySerial is licensed and distributed under the terms of the Python Software Foundation License.
Here are some key features of "pySerial":
· same class based interface on all supported platforms
· access to the port settings through Python 2.2+ properties
· port numbering starts at zero, no need to know the port name in the user program
· port string (device name) can be specified if access through numbering is inappropriate
· support for different bytesizes, stopbits, parity and flow control with RTS/CTS and/or Xon/Xoff
· working with or without receive timeout
· file like API with "read" and "write" ("readline" etc. also supported)
· The files in this package are 100% pure Python. They depend on non standard but common packages on Windows (pywin32) and Jython (JavaComm). POSIX (Linux, BSD) uses only modules from the standard Python distribution)
· The port is set up for binary transmission. No NULL byte stripping, CR-LF translation etc. (which are many times enabled for POSIX.) This makes this module universally useful.
· Python 2.2 or later
What's New in This Release: [ read full changelog ]
· Moved some of the examples to serial.tools so that they can be used
· with ``python -m``
· serial port enumeration now included as ``serial.tools.list_ports``
· URL handers for ``serial_for_url`` are now imported dynamically. This allows to add protocols w/o editing files. The list ``serial.protocol_handler_packages`` can be used to add or remove user
· packages with protocol handlers (see docs for details).
· new URL type: hwgrep:// uses list_ports module to search for ports
· by their description
· serveral internal changes to improve Python 3.x compatibility (setup.py,
· use of absolute imports and more)
· [Bug 3093882] calling open() on an already open port now raises an exception
· [Bug 3245627] connection-lost let rfc2217 hangs in closed loop
· [Patch 3147043] readlines() to support multi-character eol