Python
HORUS provides full Python bindings via PyO3, giving you the same zero-copy shared memory IPC and real-time scheduling in Python.
Quick Start
# simplified
import horus
def my_tick(node):
if node.has_msg("sensor"):
data = node.recv("sensor")
node.send("output", {"processed": data["value"] * 2})
node = horus.Node("processor", subs=["sensor"], pubs=["output"], tick=my_tick, rate=100)
horus.run(node)
API Reference
| Page | Description |
|---|---|
| Node API | Constructor kwargs, send/recv, topic specs, lifecycle |
| Scheduler API | Orchestration, RT, recording, run() |
| Topic API | Standalone pub/sub, typed vs generic |
| Clock API | now(), dt(), deterministic mode |
| Standard Messages | 75+ typed message types (sensor, control, geometry, ...) |
| Drivers | Hardware config loading from horus.toml |
| Error Types | Exception types and patterns |
| Image, PointCloud | Zero-copy domain types |
| TransformFrame | Coordinate frame tree |
| Async Nodes | Async I/O patterns |
Guides
- Real-Time Systems — Budget, deadline, miss policies, GIL implications
- Node Lifecycle — Init, tick, shutdown deep dive
- Scheduler Deep-Dive — Advanced scheduling patterns
- Topics Deep-Dive — Topic patterns and best practices
- Message Library — 75+ typed message classes
- Examples — Complete Python examples
Design Decisions
Why Python bindings instead of Python-only? The core runtime (scheduler, shared memory, transport) is Rust for deterministic real-time performance. Python bindings via PyO3 give Python users the same zero-copy IPC and scheduling guarantees. A pure Python runtime would add milliseconds of jitter to every tick and lose shared memory support.
When to use Python vs Rust: Use Python for ML inference, prototyping, data visualization, and I/O-heavy tasks (HTTP, databases). Use Rust for real-time control loops, safety-critical nodes, and high-frequency sensor processing. Both languages share the same topics and messages via zero-copy IPC.
See Also
- Quick Start (Python) — First Python application
- Choosing a Language — Rust vs Python comparison
- Python API Overview — API landing page with cross-language guide
- Real Hardware Recipe — Complete I2C + serial examples with pip libraries