The goal of this package is to provide a fast and reliable interface to the serial ports.
Instead of implementing the logic in Python, this package builds around serialport written in Rust. This package supports threading.
PyO3 (with maturin) will build a pip package for you. For this, make sure that you are able to build rust packages with cargo. Create a virtual environment and install the required pip packages with
pip install -r requirements.txt
The pip package can then easily be build with
maturin build --release
Voilà, a pip package to be used in your code!
Demo scripts are located in /python:
- demo.py shows a simple direct communication via the serial connection
- demo_threads.py demonstrates how this package can be used with threads
Link to the documentation: https://py-serial-rs.readthedocs.io/