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

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.1
File Size Uploaded
branchkit-0.1.1.tar.gz 102.2 kB Details

Built distribution (wheel)

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

Total release size: 206.1 kB

Release files / branchkit-0.1.1.tar.gz

Download URL branchkit-0.1.1.tar.gz
Size 102.2 kB
Tags Source
SHA-256 checksum
How to use checksums
06cb9e224cd15119cc07cc1fcfadb76f80d2222d324a7e115070a2fca72001b7
BLAKE2b-256 checksum
How to use checksums
4811203ad8b07da56de73846f8d6f244a5e836e7a8d9c929b4b22e33d11f39c1
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 5, 2026.

Transparency log

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

Download URL branchkit-0.1.1-py3-none-any.whl
Size 103.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce52a5459b50751b4dbc23e0c99f72cd6c9ac67c9d5472381bbe4ad4e158a063
BLAKE2b-256 checksum
How to use checksums
31c76d54c0f186e7a907c0aee262e9a85d246aa81ead7cd31471642d8721d06d
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 5, 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

This release

0.1.1 This release

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