Typed Python SDK for building MiraBox Stream Dock plugins
Project description
MiraBox Stream Dock SDK for Python
Typed, unofficial Python SDK for building plugins for MiraBox Stream Dock. It implements the WebSocket protocol, registration, typed event parsing, outbound commands, per-plugin action registration, action lifecycle, plugin services, and a shared Property Inspector client.
This project is not affiliated with or endorsed by MiraBox, HotSpot, or Elgato.
The connectElgatoStreamDeckSocket callback name is kept because Stream Dock
uses it for Property Inspector compatibility.
Requirements
- Python 3.11 or newer;
- MiraBox Stream Dock 2.10.179.426 or newer;
- Windows for packaging a Python plugin with PyInstaller.
Installation
python -m pip install mirabox-stream-dock-sdk
For SDK development:
python -m venv .venv
.venv/bin/python -m pip install -e ".[dev]"
On Windows, use .venv\Scripts\python.exe instead.
Minimal plugin
from __future__ import annotations
from dataclasses import dataclass
from mirabox_sdk import (
Action,
ActionRegistry,
JsonObject,
KeyDownEvent,
PluginLaunchArguments,
StreamDockPlugin,
StreamDockSender,
WebSocketStreamDockConnection,
WillAppearEvent,
run_plugin_cli,
)
ACTION_UUID = "com.example.counter.increment"
@dataclass(frozen=True, slots=True)
class Dependencies:
stream_dock: StreamDockSender
registry: ActionRegistry[Dependencies] = ActionRegistry()
@registry.register(ACTION_UUID)
class CounterAction(Action[JsonObject, Dependencies]):
def _render(self) -> None:
count = self.settings.get("count", 0)
self.set_title(str(count if type(count) is int else 0))
def on_will_appear(self, _event: WillAppearEvent) -> None:
self._render()
def on_key_down(self, _event: KeyDownEvent) -> None:
count = self.settings.get("count", 0)
self.set_settings({"count": (count if type(count) is int else 0) + 1})
self._render()
def build_application(arguments: PluginLaunchArguments) -> StreamDockPlugin[Dependencies]:
connection = WebSocketStreamDockConnection(arguments.port)
return StreamDockPlugin(
arguments,
stream_dock=connection,
action_registry=registry,
action_dependencies=Dependencies(connection),
)
if __name__ == "__main__":
raise SystemExit(run_plugin_cli(build_application))
The action UUID must also be declared in the plugin's manifest.json.
Property Inspector client
Copy the versioned JavaScript client into the plugin bundle:
mirabox-sdk copy-property-inspector \
com.example.counter.sdPlugin/property-inspector
Use --force to replace a different existing copy. Include the client before
the action-specific script:
<script src="mirabox-sdk.js"></script>
<script src="counter.js"></script>
The action script can use window.MiraBoxPropertyInspector:
const client = window.MiraBoxPropertyInspector;
client.on("connected", ({ settings }) => console.log(settings));
client.sendToPlugin({ event: "refresh" });
client.updateSettings({ mode: "toggle" });
Public API
events.pycontains typed inbound event models.commands.pycontains outbound command models.parser.pyvalidates wire JSON and reports exact invalid field paths.codecs.pyconverts plugin-owned settings and messages to typed objects.ActionandActionRegistrymodel action instances and registrations.StreamDockPlugindispatches events and manages service lifecycle.WebSocketStreamDockConnectionimplements the Stream Dock transport.run_plugin_clihandles the standard executable arguments and shutdown.
The supported public surface is exported from mirabox_sdk. Other module-level
objects are implementation details unless documented otherwise.
Checks
python -m unittest discover -s tests -v
python -m compileall -q src tests scripts examples
ruff check src tests scripts examples
ruff format --check src tests scripts examples
python -m build
python scripts/verify_distribution.py dist
Releasing
- Update the version in
pyproject.toml,src/mirabox_sdk/__init__.py, andCHANGELOG.md. - Run all checks and build the distributions.
- Create and push the matching tag, for example
v0.1.0. - The release workflow publishes the wheel and source archive to PyPI through Trusted Publishing and attaches them to a GitHub Release.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mirabox_stream_dock_sdk-0.1.0.tar.gz.
File metadata
- Download URL: mirabox_stream_dock_sdk-0.1.0.tar.gz
- Upload date:
- Size: 38.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c9edbd61933fd2bad863a4adf011c2a1c4e49fba8107123ae1cda0a76ddc4fa
|
|
| MD5 |
20eedb6a64cc81d93b69049444c90222
|
|
| BLAKE2b-256 |
1acbccda15b3b9cb77d34305414656f15ad7a78a4a8a749f82da0c9158787882
|
Provenance
The following attestation bundles were made for mirabox_stream_dock_sdk-0.1.0.tar.gz:
Publisher:
release.yml on Nekit678/MiraboxStreamDockSDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mirabox_stream_dock_sdk-0.1.0.tar.gz -
Subject digest:
8c9edbd61933fd2bad863a4adf011c2a1c4e49fba8107123ae1cda0a76ddc4fa - Sigstore transparency entry: 2198627006
- Sigstore integration time:
-
Permalink:
Nekit678/MiraboxStreamDockSDK@ceca5f306d758c1eebc0221a9fa6803c64cfd315 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Nekit678
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ceca5f306d758c1eebc0221a9fa6803c64cfd315 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mirabox_stream_dock_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mirabox_stream_dock_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4934103b51d9f748c23fc09fa30c8eb0c9ac37ef89955b164548074c4d7929b1
|
|
| MD5 |
5a526e4d060f70149d890857ac7e8043
|
|
| BLAKE2b-256 |
6142a7a83a0ecd6c44a07d147ac3983b22d57471db9f4096250d09504e9fb11d
|
Provenance
The following attestation bundles were made for mirabox_stream_dock_sdk-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Nekit678/MiraboxStreamDockSDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mirabox_stream_dock_sdk-0.1.0-py3-none-any.whl -
Subject digest:
4934103b51d9f748c23fc09fa30c8eb0c9ac37ef89955b164548074c4d7929b1 - Sigstore transparency entry: 2198627104
- Sigstore integration time:
-
Permalink:
Nekit678/MiraboxStreamDockSDK@ceca5f306d758c1eebc0221a9fa6803c64cfd315 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Nekit678
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ceca5f306d758c1eebc0221a9fa6803c64cfd315 -
Trigger Event:
push
-
Statement type: