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.1.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.1.0
File Size Uploaded
branchkit-0.1.0.tar.gz 95.8 kB Details

Built distribution (wheel)

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

Total release size: 195.1 kB

Release files / branchkit-0.1.0.tar.gz

Download URL branchkit-0.1.0.tar.gz
Size 95.8 kB
Tags Source
SHA-256 checksum
How to use checksums
11baae9a5846ffa90df9f3cf0e5c62ede5485a639b636df9520bef765bbf645a
BLAKE2b-256 checksum
How to use checksums
2eca799bb5a1a81003d85dc4eecdd8284d0b8488c26bb3b7ce063db4b04ab4e4
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 Aug 23, 2026.

Transparency log

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

Download URL branchkit-0.1.0-py3-none-any.whl
Size 99.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f31029ef79207b9042ee8784805ffe41b326411828aa75e215fb1e80d6d61ef
BLAKE2b-256 checksum
How to use checksums
8305f9e4015858865a68d5ab64a7aa631e90b6aecb5768e4c7330aeea4a9e8df
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 Aug 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

This release

0.1.0 This release

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