SCARA Robot Communication Library
scaracom is a dedicated Python communication library providing pure Layer 0 Hardware Transport, Layer 1 Protocol Bridge, and Layer 2 Flow Control components for the SCARA robotic manipulator ecosystem (scaraemu, scarajectory, and scaralang).
Developed in python code.
The README is used to introduce the modules and provide instructions on how to install the modules, any machine dependencies it may have and any other information that should be provided before the modules are installed.
Table of Contents
- 🚀 Installation
- 📦 Dependencies
- 📁 Framework structure
- 📊 Code coverage
- 🛠 Usage
- 📚 Docs
- 👥 Contributing
- 📄 Copyright and licence
🚀 Installation
Install using pip
# python3
pip3 install scaracom
Install using build
Navigate to release page download and extract release archive.
To install scaracom type the following
tar xvzf scaracom-x.y.z.tar.gz
cd scaracom-x.y.z/
# python3
python3 -m pip install .
Install using py setup
python3 setup.py install --record files.txt
📦 Dependencies
scaracom is extremely lightweight and requires only:
pyserial(in addition to Python standard library built-ins)
📁 Framework structure
scaracom is based on OOP and Clean Architecture.
Click to expand framework structure
scaracom/
├── bridge/
│ ├── coordinator/
│ │ ├── coordinator.py
│ │ ├── dependencies.py
│ │ ├── factory.py
│ │ ├── icoordinator.py
│ │ └── __init__.py
│ ├── dependencies.py
│ ├── factory.py
│ ├── __init__.py
│ ├── listener/
│ │ ├── factory.py
│ │ ├── holder.py
│ │ ├── iholder.py
│ │ ├── __init__.py
│ │ └── itransport_listener.py
│ ├── provides.py
│ ├── receiver/
│ │ ├── dependencies.py
│ │ ├── factory.py
│ │ ├── __init__.py
│ │ ├── ireceiver.py
│ │ └── receiver.py
│ └── transceiver/
│ ├── dependencies.py
│ ├── factory.py
│ ├── ibyte_sender.py
│ ├── ichannel.py
│ ├── __init__.py
│ └── transceiver.py
├── flow/
│ ├── barrier/
│ │ ├── barrier.py
│ │ ├── factory.py
│ │ ├── ibarrier.py
│ │ ├── __init__.py
│ │ └── provides.py
│ ├── __init__.py
│ ├── pacing/
│ │ ├── dependencies.py
│ │ ├── factory.py
│ │ ├── __init__.py
│ │ ├── iwindow.py
│ │ ├── provides.py
│ │ └── window.py
│ ├── queue/
│ │ ├── factory.py
│ │ ├── __init__.py
│ │ ├── iqueue.py
│ │ ├── provides.py
│ │ └── queue.py
│ ├── router/
│ │ ├── factory.py
│ │ ├── iframe.py
│ │ ├── ihandler.py
│ │ ├── __init__.py
│ │ ├── irouter.py
│ │ ├── provides.py
│ │ └── router.py
│ └── sequence/
│ ├── coordinator.py
│ ├── factory.py
│ ├── icoordinator.py
│ ├── __init__.py
│ └── provides.py
├── __init__.py
├── py.typed
└── transport/
├── driver/
│ ├── factory.py
│ ├── idriver.py
│ ├── __init__.py
│ └── pyserial_driver.py
├── factory.py
├── __init__.py
├── itransport.py
├── preference/
│ ├── __init__.py
│ ├── irepository.py
│ └── preference.py
├── scanner/
│ ├── factory.py
│ ├── __init__.py
│ ├── iport_scanner.py
│ └── port_scanner.py
└── transport.py
16 directories, 71 files
🏗 Architecture & SOLID Principles
SOLID Principles Compliance
- Single Responsibility Principle (SRP): Subsystems and components contain strictly 2 to 4 cohesive public methods.
- Open/Closed Principle (OCP): Protocol extensions hook into typed event delegates without modifying core transport loops.
- Liskov Substitution Principle (LSP): Pure structural subtyping via
typing.Protocolwith zero multi-inheritance or@overridedecorators. - Interface Segregation Principle (ISP): Clients depend strictly on narrow role protocols (
ITransport,IConnection,IStream,IConnectionCoordinator). - Dependency Inversion Principle (DIP): Collaborators are injected as structural protocols with frozen dataclass bundles (
dependencies.py➔factory.py➔provides.py).
Automated Quality Gates (run_quality_gates.sh)
interfaces_checker: Verifies structural protocol adherence.isp_checker: Enforces method count limits per role interface.limits_checker: Enforces max file lengths and line character boundaries.srp_checker: Enforces Single Responsibility constraints.
📊 Code coverage
Click to expand code coverage
| Name | Stmts | Miss | Cover |
|---|---|---|---|
scaracom/__init__.py |
9 | 0 | 100% |
scaracom/bridge/__init__.py |
9 | 0 | 100% |
scaracom/bridge/coordinator/__init__.py |
9 | 0 | 100% |
scaracom/bridge/coordinator/coordinator.py |
56 | 0 | 100% |
scaracom/bridge/coordinator/dependencies.py |
20 | 0 | 100% |
scaracom/bridge/coordinator/factory.py |
20 | 0 | 100% |
scaracom/bridge/coordinator/icoordinator.py |
17 | 0 | 100% |
scaracom/bridge/dependencies.py |
16 | 0 | 100% |
scaracom/bridge/factory.py |
36 | 0 | 100% |
scaracom/bridge/listener/__init__.py |
9 | 0 | 100% |
scaracom/bridge/listener/factory.py |
20 | 0 | 100% |
scaracom/bridge/listener/holder.py |
29 | 0 | 100% |
scaracom/bridge/listener/iholder.py |
16 | 0 | 100% |
scaracom/bridge/listener/itransport_listener.py |
15 | 0 | 100% |
scaracom/bridge/provides.py |
20 | 0 | 100% |
scaracom/bridge/receiver/__init__.py |
9 | 0 | 100% |
scaracom/bridge/receiver/dependencies.py |
18 | 0 | 100% |
scaracom/bridge/receiver/factory.py |
20 | 0 | 100% |
scaracom/bridge/receiver/ireceiver.py |
15 | 0 | 100% |
scaracom/bridge/receiver/receiver.py |
48 | 0 | 100% |
scaracom/bridge/transceiver/__init__.py |
9 | 0 | 100% |
scaracom/bridge/transceiver/dependencies.py |
16 | 0 | 100% |
scaracom/bridge/transceiver/factory.py |
20 | 0 | 100% |
scaracom/bridge/transceiver/ibyte_sender.py |
14 | 0 | 100% |
scaracom/bridge/transceiver/ichannel.py |
15 | 0 | 100% |
scaracom/bridge/transceiver/transceiver.py |
32 | 0 | 100% |
scaracom/flow/__init__.py |
9 | 0 | 100% |
scaracom/flow/barrier/__init__.py |
9 | 0 | 100% |
scaracom/flow/barrier/barrier.py |
25 | 0 | 100% |
scaracom/flow/barrier/factory.py |
18 | 0 | 100% |
scaracom/flow/barrier/ibarrier.py |
17 | 0 | 100% |
scaracom/flow/barrier/provides.py |
14 | 0 | 100% |
scaracom/flow/pacing/__init__.py |
9 | 0 | 100% |
scaracom/flow/pacing/dependencies.py |
13 | 0 | 100% |
scaracom/flow/pacing/factory.py |
20 | 0 | 100% |
scaracom/flow/pacing/iwindow.py |
16 | 0 | 100% |
scaracom/flow/pacing/provides.py |
14 | 0 | 100% |
scaracom/flow/pacing/window.py |
39 | 0 | 100% |
scaracom/flow/queue/__init__.py |
9 | 0 | 100% |
scaracom/flow/queue/factory.py |
18 | 0 | 100% |
scaracom/flow/queue/iqueue.py |
17 | 0 | 100% |
scaracom/flow/queue/provides.py |
14 | 0 | 100% |
scaracom/flow/queue/queue.py |
36 | 0 | 100% |
scaracom/flow/router/__init__.py |
9 | 0 | 100% |
scaracom/flow/router/factory.py |
18 | 0 | 100% |
scaracom/flow/router/iframe.py |
20 | 0 | 100% |
scaracom/flow/router/ihandler.py |
15 | 0 | 100% |
scaracom/flow/router/irouter.py |
18 | 0 | 100% |
scaracom/flow/router/provides.py |
14 | 0 | 100% |
scaracom/flow/router/router.py |
45 | 0 | 100% |
scaracom/flow/sequence/__init__.py |
9 | 0 | 100% |
scaracom/flow/sequence/coordinator.py |
29 | 0 | 100% |
scaracom/flow/sequence/factory.py |
18 | 0 | 100% |
scaracom/flow/sequence/icoordinator.py |
16 | 0 | 100% |
scaracom/flow/sequence/provides.py |
14 | 0 | 100% |
scaracom/transport/__init__.py |
9 | 0 | 100% |
scaracom/transport/driver/__init__.py |
9 | 0 | 100% |
scaracom/transport/driver/factory.py |
18 | 0 | 100% |
scaracom/transport/driver/idriver.py |
17 | 0 | 100% |
scaracom/transport/driver/pyserial_driver.py |
52 | 0 | 100% |
scaracom/transport/factory.py |
21 | 0 | 100% |
scaracom/transport/itransport.py |
17 | 0 | 100% |
scaracom/transport/preference/__init__.py |
9 | 0 | 100% |
scaracom/transport/preference/irepository.py |
17 | 0 | 100% |
scaracom/transport/preference/preference.py |
14 | 0 | 100% |
scaracom/transport/scanner/__init__.py |
9 | 0 | 100% |
scaracom/transport/scanner/factory.py |
18 | 0 | 100% |
scaracom/transport/scanner/iport_scanner.py |
14 | 0 | 100% |
scaracom/transport/scanner/port_scanner.py |
39 | 0 | 100% |
scaracom/transport/transport.py |
37 | 0 | 100% |
| Total | 1339 | 0 | 100% |
🛠 Usage
Port Scanning & Hardware Discovery
from scaracom.transport.scanner.factory import PortScannerFactory
# Discover available hardware serial ports with descriptions
scanner = PortScannerFactory.create()
ports = scanner.scan_ports()
print("Detected serial ports:", ports)
Serial Transport Setup
from scaracom.transport.factory import SerialTransportFactory
# Initialize physical serial connection (Layer 0)
transport = SerialTransportFactory.create(port="/dev/ttyUSB0", baudrate=115200)
if transport.connect():
transport.write_bytes(b"\x01\x00\x00\x00")
response = transport.read_bytes(size=64)
transport.disconnect()
Protocol Bridge & Listener Dispatch
from scaracom.bridge.factory import BridgeFactory
from scaracom.bridge.dependencies import BridgeDependencies
from scaracom.transport.factory import SerialTransportFactory
# Initialize transport and bridge (Layer 1)
transport = SerialTransportFactory.create(port="/dev/ttyUSB0", baudrate=115200)
bridge_provides = BridgeFactory.create(BridgeDependencies(transport=transport))
# Connect coordinator and dispatch byte streams
bridge_provides.coordinator.connect()
bridge_provides.transceiver.send_bytes(b"\x01\x02\x03\x04")
bridge_provides.coordinator.disconnect()
Flow Control & Frame Routing
from scaracom.flow.router.factory import FrameRouterFactory
from scaracom.flow.router.iframe import IRoutedFrame
from scaracom.flow.barrier.factory import FlowBarrierFactory
# Demultiplex incoming frames via structural protocol (Layer 2)
router = FrameRouterFactory.create()
barrier = FlowBarrierFactory.create()
# Arm flow barrier for synchronized command execution
barrier.arm()
barrier.wait_until_unblocked(timeout=1.0)
📚 Docs
More documentation and info at
👥 Contributing
Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md for details on our code of conduct, and the process for submitting pull requests to us.
📄 Copyright and licence
Copyright (C) 2026 by vroncevic.github.io/scaracom
scaracom is free software; you can redistribute it and/or modify it under the same terms as Python itself, either Python version 3.x or, at your option, any later version of Python 3 you may have available.
Special thanks to Google and the Google developer ecosystem for their tremendous support and innovative tools from the Google bundle that empowered the development and realization of this project. Google, you make this world a better place! 🌍✨
Lets help and support PSF.
Metadata
Release files for scaracom 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scaracom-1.0.2.tar.gz | 41.1 kB | Without provenance | Details for scaracom-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scaracom-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for scaracom-1.0.2-py3-none-any.whl |
Total release size: 141.2 kB
Release files / scaracom-1.0.2.tar.gz
| Download URL | scaracom-1.0.2.tar.gz |
|---|---|
| Size | 41.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73bac659f85637de0935013d066d47b0a8a28a93e61de955848659589a52863a
|
|
BLAKE2b-256 checksum How to use checksums |
6aa1b2ca8e75136ea814e8a3315f38a1d9880d75de8da8fe46c5bc0dc7b31d3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.0 CPython/3.12.3
|
Release files / scaracom-1.0.2-py3-none-any.whl
| Download URL | scaracom-1.0.2-py3-none-any.whl |
|---|---|
| Size | 100.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
289a52f5c438bb735abd7f087a648ead2fe904072c6ce1e453769f023a1a3092
|
|
BLAKE2b-256 checksum How to use checksums |
e357896ef1926f626a07d73d3289df6dadc49fd80f2cc11e6f6601d65718cbea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.0 CPython/3.12.3
|
Security for scaracom 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.