Skip to content

Python API

beebo.api exposes the same device logic as a library, without the Typer CLI: no argv[0] node identity, and errors raised as BeeboError (with BeeboTimeoutError and BeeboDeviceError) instead of a printed message and an exit code. SyncNode is the blocking facade; Node is the async primitive with the same methods.

from beebo.api import SyncNode

with SyncNode(node="gatto").connect() as node:
    print(node.name, node.role, node.transport)
    print(node.status()["node"]["uptime_secs"])
    node.settings.repeater.routing.tuning.trial.block_size_s = 300
    files = node.monitor_pull()
  • Target: at most one of node=, ble=, tcp=, usb=, on the constructor or on connect(). node= reads ~/.beebo/nodes/<node>/profile.toml; a connect() target persists on the object.
  • Methods: status(), battery(), reboot(), advert(), region_*(), channels_*() and channel_*() (list, get, set, remove, send, push, pull), traffic_inject(), sustain_start()/sustain_stop()/sustain_status(), download_messages(), send_message(), refresh_contacts(), lookup_contact(), monitor_stats()/monitor_status()/monitor_clear()/monitor_pull(), and get(path)/set(path, value) for one setting by dotted path. Properties: name, role, transport, mc. Every signature is in the Python API Reference.
  • Settings tree: node.settings.<path> reads or writes a leaf as an attribute, and with group.restored(): puts every setting under that group back on exit.
  • Trials: beebo.trials.Trial.latest(node.monitor_pull()) (or Trial.from_files(files) for all of them) reads pulled trials offline (outcome, change, se, confidence, pairs, report()).
  • Context managers disconnect on exit but do not connect on entry, so a connect failure is an ordinary exception you can catch around the with.

SyncNode runs one background event loop for the whole process, so drive each SyncNode from one thread and use Node for concurrent event streams. Runnable examples: beebo/examples/two_nodes_{sync,async,with}.py, and beebo run api-demo / api-sync-demo.