Skip to main content

scirodev

Host-side companion to the PeakHub firmware: typed API stubs for the sciro namespace that PeakHub programs import, plus the hub tooling (it depends on pybricksdev, so scirodev run ble prog.py works exactly like pybricksdev).

pip install scirodev                                    # from PyPI
pip install "scirodev @ git+https://github.com/sciurus-robotics/scirodev.git@v0.1.0"
pipx install scirodev                                   # just the CLI, in its own venv

Hacking on it:

pip install -e .

Then your IDE/type checker knows these, which the upstream pybricks stubs don't:

from sciro.parameters import Port          # Port.A .. Port.H (PeakHub has 8 ports)
from sciro.iodevices import PUMPDevice     # generic PUMP device access
from sciro.pump import FloorPro        # PUMP devices (LP-FloorPro, ...)
from sciro.hubs import PeakHub             # hub class incl. display.device()
from sciro.tools import RingBuffer         # experimental: RAM recorder -> CSV file via the console
from sciro.robotics import PIDController   # experimental: PID with optional logging

hub = PeakHub()
fp = FloorPro(Port.G)
cog_dark, cog_bright, brightness, darkness, mask, calibrating = fp.line.read()
hub.display.device(fp, brightness=50)      # mirror the sensor's LED strip on the 5x5

Experimental (API may change): a RAM recorder that publishes CSV through the console, and a PID controller that can log into it:

from sciro.robotics import PIDController
from sciro.tools import RingBuffer

pid = PIDController(kp=15, kd=0.2, output_limit=300)
log = pid.make_log(seconds=10, rate=100)     # RingBuffer of pid.LOG_FIELDS
turn_rate = pid.update(error, derivative=-hub.imu.angular_velocity(Axis.Z))
log.publish("doc/pid_run.csv")               # scirodev run writes the file next to the script

The drivebase's own controllers log too (built into Pybricks, undocumented upstream): db.heading_control.log.start(5000, down_sample=2) records the reference trajectory, the estimated state and the P/I/D terms at 100 Hz from the firmware's control loop; db.heading_control.log.publish("heading.csv") writes it with a header line. sciro.robotics.DriveBase is the Pybricks class with these attributes typed. log.record(db.state) is the coroutine form for anything else.

publish(path) wraps the CSV in pybricksdev's _file_begin_ <path> / _file_end_ lines; scirodev run (and pybricksdev run) then write the block to that file, relative to the script's folder, instead of echoing it. Without a path the CSV goes to the terminal.

Full demo programs for the LP FloorPro (both for LEGO hubs and the PeakHub) live in sciurus-robotics/FloorPro-CodeDemos; examples/ here stays minimal.

On the hub these modules are frozen into the PeakHub firmware: sciro.parameters and sciro.iodevices re-export the same runtime objects as their pybricks.* counterparts, so sciro.parameters.Port is pybricks.parameters.Port — the stubs only add what the IDE is missing. The stub files here mirror the frozen modules; a release of this package matches the PeakHub firmware of the same date.

API reference (HTML)

The stubs double as the source of the API reference, built with Sphinx the way docs.pybricks.com is (cross-links into it for the upstream types):

pip install -e ".[docs]"
scripts/build-docs            # -> docs/_build/html/index.html

The build output is static HTML; a website can copy that folder as is.

Releasing

Bump version in pyproject.toml, commit, tag vX.Y.Z and push the tag. The GitHub workflow builds, type-checks and publishes to PyPI via Trusted Publishing (configured on pypi.org: owner sciurus-robotics, repo scirodev, workflow publish.yml, environment pypi).

Metadata

Release files for scirodev 0.5.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scirodev 0.5.6
File Size Uploaded
scirodev-0.5.6.tar.gz 19.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scirodev 0.5.6
File Interpreter ABI Platform
scirodev-0.5.6-py3-none-any.whl Python 3 none any Details

Total release size: 40.4 kB

Release files / scirodev-0.5.6.tar.gz

Download URL scirodev-0.5.6.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0f6d993e39ee325790b9cc08aef92af437632dda954a747bc09740acf03d54e1
BLAKE2b-256 checksum
How to use checksums
bc10ecda67ad9c41d6301e0a1d2db71df21671045b2f479236553f0dbaf6b1d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / scirodev-0.5.6-py3-none-any.whl

Download URL scirodev-0.5.6-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad842971fdafca927134bb12614930d173978107c8269962d5395c90f863e5b4
BLAKE2b-256 checksum
How to use checksums
436d8575a723f0a1deeaf6714a269d423181da76d2fd1b469fb586662305de2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.3

2 release files

This release

0.5.6 This release

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page