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

PageDescription
Node APIConstructor kwargs, send/recv, topic specs, lifecycle
Scheduler APIOrchestration, RT, recording, run()
Topic APIStandalone pub/sub, typed vs generic
Clock APInow(), dt(), deterministic mode
Standard Messages75+ typed message types (sensor, control, geometry, ...)
DriversHardware config loading from horus.toml
Error TypesException types and patterns
Image, PointCloudZero-copy domain types
TransformFrameCoordinate frame tree
Async NodesAsync I/O patterns

Guides

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