Skip to main content

spine-py

Python bindings for the Spine communication framework. Allows Python-based modules to publish, subscribe, and make RPC calls over the Spine network.

Installation

pip install spine-py

Quick Start

from spine import Node

node = Node("my-node")

@node.subscribe("sensor/data")
def handle(msg):
print(msg.payload)

node.publish("sensor/data", b"hello")
node.start() # begins mDNS discovery automatically

RPC

# Expose a service
@node.handle("arm/move")
def move(req):
return b"ok"

# Call a remote service
resp = node.call("arm/move", b"target")