serial_interface_python
Extends pyserial-asyncio to add convenience methods.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.6%) to scientific vocabulary
Repository
Extends pyserial-asyncio to add convenience methods.
Basic Info
Statistics
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
About
markdown
- Name: serial_interface
- Description: Extends pyserial to make serial device interfaces.
- Version: 2.4.4
- Python Version: 3.10
- Release Date: 2025-03-20
- Creation Date: 2018-01-11
- License: BSD-3-Clause
- URL: https://github.com/janelia-python/serial_interface_python
- Author: Peter Polidoro
- Email: peter@polidoro.io
- Copyright: 2025 Howard Hughes Medical Institute
- References:
- https://pyserial.readthedocs.io/en/latest/
- Dependencies:
- pyserial
Example Usage
Python
```python from serialinterface import SerialInterface, findserialinterfaceports findserialinterface_ports() # Returns list of available serial ports
dev = SerialInterface() # Might automatically find device if one available
if it is not found automatically, specify port directly
dev = SerialInterface(port='/dev/ttyUSB0') # Linux dev = SerialInterface(port='/dev/tty.usbmodem262471') # Mac OS X dev = SerialInterface(port='COM3') # Windows
dev.getdeviceinfo()
from serial_interface import SerialInterfaces
devs = SerialInterfaces() # Might automatically find all available devices
if they are not found automatically, specify ports to use
devs = SerialInterfaces(useports=['/dev/ttyUSB0','/dev/ttyUSB1']) # Linux devs = SerialInterfaces(useports=['/dev/tty.usbmodem262471','/dev/tty.usbmodem262472']) # Mac OS X devs = SerialInterfaces(use_ports=['COM3','COM4']) # Windows
devs.getdevicesinfo() devs.sortbyport() dev = devs[0] dev.getdeviceinfo() ```
Command Line
```sh
```
Installation
https://github.com/janelia-python/python_setup
GNU/Linux
Drivers
GNU/Linux computers usually have all of the necessary drivers already installed, but users need the appropriate permissions to open the device and communicate with it.
Udev is the GNU/Linux subsystem that detects when things are plugged into your computer.
Udev may be used to detect when a serial device is plugged into the computer and automatically give permission to open that device.
If you plug a sensor into your computer and attempt to open it and get an error such as: "FATAL: cannot open /dev/ttyUSB0: Permission denied", then you need to install udev rules to give permission to open that device.
Udev rules may be downloaded as a file and placed in the appropriate directory using these instructions:
Download rules into the correct directory
sh curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/master/scripts/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rulesRestart udev management tool
sh sudo service udev restartUbuntu/Debian users may need to add own “username” to the “dialout” group
sh sudo usermod -a -G dialout $USER sudo usermod -a -G plugdev $USERAfter setting up rules and groups
You will need to log out and log back in again (or reboot) for the user group changes to take effect.
After this file is installed, physically unplug and reconnect your board.
Python Code
The Python code in this library may be installed in any number of ways, chose one.
pip
sh python3 -m venv ~/venvs/ source ~/venvs//bin/activate pip installguix
Setup guix-janelia channel:
https://github.com/guix-janelia/guix-janelia
sh guix install python-serial-interface
Windows
Drivers
Download and install driver for the specific serial device.
Python Code
The Python code in this library may be installed in any number of ways, chose one.
pip
sh python3 -m venv C:\venvs\ C:\venvs\\Scripts\activate pip install
Development
Install Guix
Clone Repository
sh
git clone https://github.com/janelia-python/serial_interface_python
cd serial_interface_python
Edit metadata.org
sh
make metadata-edits
Tangle metadata.org
sh
make metadata
Test Python package using ipython shell
```sh make ipython-shell # PORT=/dev/ttyUSB0
make PORT=/dev/ttyUSB1 ipython-shell
import exit ```
Test installation of Guix package
```sh make installed-shell # PORT=/dev/ttyUSB0
make PORT=/dev/ttyUSB1 installed-shell
exit ```
Upload Python package to pypi
sh
make upload
Test direct device interaction using serial terminal
```sh make serial-shell # PORT=/dev/ttyUSB0
make PORT=/dev/ttyUSB1 serial-shell
? # help settings [C-a][C-x] # to exit ```
Owner
- Name: Janelia Python
- Login: janelia-python
- Kind: organization
- Repositories: 2
- Profile: https://github.com/janelia-python
Janelia Python Packages
CodeMeta (codemeta.json)
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"license": "https://spdx.org/licenses/BSD-3-Clause",
"codeRepository": "https://github.com/janelia-python/serial_interface_python",
"dateCreated": "2018-01-11",
"dateModified": "2025-03-20",
"name": "serial_interface",
"version": "2.4.4",
"description": "Extends pyserial to make serial device interfaces.",
"programmingLanguage": [
"Python 3"
],
"author": [
{
"@type": "Person",
"givenName": "Peter",
"familyName": "Polidoro",
"email": "peter@polidoro.io",
"affiliation": {
"@type": "Organization",
"name": "Howard Hughes Medical Institute"
}
}
]
}
GitHub Events
Total
- Push event: 3
- Create event: 2
Last Year
- Push event: 3
- Create event: 2
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 3 days
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 3 days
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- amites (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 479 last-month
- Total dependent packages: 2
- Total dependent repositories: 2
- Total versions: 20
- Total maintainers: 1
pypi.org: serial-interface
Extends pyserial to make serial device interfaces.
- Homepage: https://github.com/janelia-python/serial_interface_python
- Documentation: https://serial-interface.readthedocs.io/
- License: BSD-3-Clause
-
Latest release: 2.4.4
published about 1 year ago