Skip to main content

BranchKit Plugin SDK (Python)

The Python SDK for building BranchKit plugins — processes (run under BranchKit's managed CPython) that add voice commands, window management, browser integration, or anything else to the BranchKit platform. MIT licensed. Feature-parity with the Go and TypeScript SDKs, verified by a shared conformance harness. Stdlib-only: importing the SDK forces no third-party dependency on any plugin.

Start here

Minimal plugin

import asyncio
import branchkit

plugin = branchkit.Plugin()

@plugin.handle_action("myplugin.greet")
async def greet(req):
    await plugin.input_type_text("Hello!")
    return {"status": "ok"}

asyncio.run(plugin.run())

Pair with a plugin.json manifest declaring the action and "runtimes": ["python"] (run: "python3 main.py") — see the tutorial. branchkit-gen generates typed params (TypedDict) and registrars from your manifest's action_types.

Handlers may be async def (run on the asyncio loop) or plain def (auto-offloaded to a worker thread, so a blocking body cannot freeze the plugin — use plugin.call_sync(...) there instead of await).

Key surfaces

Need API
Handle an action @plugin.handle_action("prefix.name") (alias @plugin.action)
Handle an RPC method @plugin.handle("my_method")
Listen for events @plugin.on(EVENT_COLLECTION_UPDATED)
Call the actuator generated wrappers (await plugin.collection_get(...), 600+) or raw plugin.call
State verbs plugin.get/list/put/patch/delete/replace/...
Logs (append-only) plugin.append/append_keyed/list_log/...
Mirrors plugin.mirror_collection(name), plugin.settings(name)
Commands branchkit.command(...) builder, push_command_group
Leveled logging await plugin.info(tag, data) (trace/debug/info/warn/error)
Local listener branchkit.listen_local(plugin) (serves inherited fds)
Outbound HTTP branchkit.UpstreamClient / urllib.request.urlopen (both proxy-aware)
Author tests branchkit.harness.Harness

Development

python3 -m unittest discover -s tests     # the SDK's own suite

The cross-language conformance suite lives in the app workspace (branchkit-sdk-test against sdk-test/testplugin-py). Generated files (*_gen.py) are emitted by emit-sdk — edit the inventory, not the files.

Metadata

Release files for branchkit 0.2.0

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

Source distribution (sdist)

Source distribution for branchkit 0.2.0
File Size Uploaded
branchkit-0.2.0.tar.gz 105.4 kB Details

Built distribution (wheel)

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

Total release size: 211.5 kB

Release files / branchkit-0.2.0.tar.gz

Download URL branchkit-0.2.0.tar.gz
Size 105.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5d1a68d30fd7bbc5f8ba378bcf3c24f0b839f988ff75a62f71962fb01228f05e
BLAKE2b-256 checksum
How to use checksums
260b0cf95e264a3d36303acfa9323d181e55da801b488a0aa50f7d6b795cad93
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 16, 2026.

Transparency log

Release files / branchkit-0.2.0-py3-none-any.whl

Download URL branchkit-0.2.0-py3-none-any.whl
Size 106.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58b3dd10fc2490286d5b4854dc54a8a22d57d6f4987d776ce913561cc8166594
BLAKE2b-256 checksum
How to use checksums
8eb3964108c69e661190ecca71b7238ea297a7c1cffa0563f32b76cc349d2093
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 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.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