Drop-in 1-to-N multiplexer for pySerial hardware serial interfaces
Project description
pySerialMux
Drop-in 1-to-N multiplexer for pyserial hardware serial interfaces.
Quick usage
from pySerialMux import Serial
with Serial("/dev/ttyUSB0", baudrate=115200, timeout=1.0) as ser:
ser.write(b"hello\n")
print(ser.readline())
On-demand QoL and debug options
The proxy accepts optional flags through Serial(...):
-
debug=True
Enables debug logging for proxy/broker lifecycle details. -
ignore_baudrate_diff=True
Allows a client to connect even when its requested baudrate differs from the broker's baudrate. -
virtual_interface="<name>"
Enables virtual routing mode for that interface name. -
client_id="<id>"
Required whenvirtual_interfaceis used. -
host_virtual_interface=True
Marks the client as host for that virtual interface. Non-host clients writing to that interface are routed to the host client instead of physical serial.
Virtual interface example
# host side
host = Serial(
"/dev/ttyUSB0",
virtual_interface="lab-bus",
client_id="host-1",
host_virtual_interface=True,
)
# client side
client = Serial(
"/dev/ttyUSB0",
virtual_interface="lab-bus",
client_id="client-1",
)
client.write(b"message to host")
print(host.read(15))
CI/CD
This repository includes GitHub Actions workflows for:
- CI test matrix on push and pull requests (
.github/workflows/ci.yml) - Auto publish to PyPI on GitHub release publish (
.github/workflows/publish-pypi.yml)
For PyPI publishing, configure trusted publishing (OIDC) for this repository in
the PyPI project settings and use the pypi GitHub environment.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyserialmux-0.1.2.tar.gz.
File metadata
- Download URL: pyserialmux-0.1.2.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f60cc006c46fd71509b4a77989a90f964d331b763b9fa85545ef28e6513599f6
|
|
| MD5 |
d1879cb963e3e08db6313fd933a9a9da
|
|
| BLAKE2b-256 |
d1d58ff4f609bc10211a84cde41e1d0d4d2105958707efb678c8240ed88aed7d
|
Provenance
The following attestation bundles were made for pyserialmux-0.1.2.tar.gz:
Publisher:
publish-pypi.yml on KilianSen/pySerialMux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyserialmux-0.1.2.tar.gz -
Subject digest:
f60cc006c46fd71509b4a77989a90f964d331b763b9fa85545ef28e6513599f6 - Sigstore transparency entry: 1176016359
- Sigstore integration time:
-
Permalink:
KilianSen/pySerialMux@c4fda6ea914207afaa1929112e453c13919c3717 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/KilianSen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c4fda6ea914207afaa1929112e453c13919c3717 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyserialmux-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pyserialmux-0.1.2-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cca945b4af80bb59db4324b130503942c97593beafe101d498aad1278f1ede45
|
|
| MD5 |
b1cdc6550524fdfef3fab7b3ce4b8ab8
|
|
| BLAKE2b-256 |
30258e31354e94dc3771ffbe49e22700ead4f76a5fcce04a3a7bdda9717fca68
|
Provenance
The following attestation bundles were made for pyserialmux-0.1.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on KilianSen/pySerialMux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyserialmux-0.1.2-py3-none-any.whl -
Subject digest:
cca945b4af80bb59db4324b130503942c97593beafe101d498aad1278f1ede45 - Sigstore transparency entry: 1176016407
- Sigstore integration time:
-
Permalink:
KilianSen/pySerialMux@c4fda6ea914207afaa1929112e453c13919c3717 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/KilianSen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c4fda6ea914207afaa1929112e453c13919c3717 -
Trigger Event:
workflow_dispatch
-
Statement type: