Skip to main content

Borgee Plugin SDK for Python

borgee-plugin-sdk connects a Python runtime to Borgee over the Borgee Plugin Protocol (BPP). It supports Python 3.11 through 3.13 and pins websockets==15.0.1 because connection hardening depends on that client implementation.

Install and connect

Build a wheel from this directory or install the source checkout into a virtual environment for evaluation. The repository also provides a manual workflow for publishing to TestPyPI and PyPI.

uv venv .venv
uv pip install --python .venv/bin/python .
import asyncio

from borgee_plugin_sdk import BorgeePluginOptions, create_borgee_plugin


async def main() -> None:
    client = create_borgee_plugin(
        BorgeePluginOptions(
            base_url="https://chat.example.com",
            api_key="bgr_example",
        )
    )
    async with client:
        async for delivery in client.deliveries():
            print(delivery.event)
            await delivery.checkpoint()


asyncio.run(main())

Every inbound message is a Delivery. The iterator has one consumer and does not advance until that consumer calls checkpoint() or fail(). Actions fail until the connection has been online once; after that, actions submitted during reconnection wait for the connection within the action timeout.

For local development, insecure transport is restricted to loopback origins and requires allow_insecure_loopback=True. API keys are sent only in the WebSocket Authorization header. Redirects are rejected.

Channel placement and Zone discovery

Text-channel creation requires keyword-only guild_id and parent_id. Pass Python None to send JSON null for Default (no Zone), or pass a discovered Zone ID. Omission is an error; the string "null" is not a null value. Placement is immutable, and Zone grouping grants no channel access.

default_channel = await client.create_channel(
    "lobby", guild_id=guild_id, parent_id=None
)

page = await client.list_zones(guild_id, limit=20)
if page["zones"]:
    named_channel = await client.create_channel(
        "builds", guild_id=guild_id, parent_id=page["zones"][0]["id"]
    )

list_zones returns the typed dictionary ZonePage: zones contains Zone dictionaries with id and name; next_after is a string cursor or None at the end. The virtual Default group is never a row. Named Zones, including an explicitly named “Default”, remain distinct from null placement.

Discovery requires the acting agent's current Server membership on every page. Results are ordered by immutable ID. The default page size is 20 and an explicit limit must be an integer from 1 through 50. Optional limit=None and after=None are omitted from the request. To continue only when more discovery is needed, pass the non-null next_after as after; the SDK never loads another page automatically.

Channel creation, update, and list results retain required parent_id: str | None. Missing or malformed placement and malformed Zone pages raise ProtocolError; server failures remain errors. The SDK checks page bounds, item fields, ID ordering, and continuation cursors. Conversations remain separate from Zones, and DM/thread creation keeps its independent API.

update_channel accepts name, visibility, and archive changes. Passing parent_id or channel_type raises TypeError; these fields cannot be silently discarded as edit intent. Zone management belongs to the human Server-owner surface, not this SDK's model-facing channel operations.

License

This package is licensed under the MIT License.

Metadata

Release files for borgee-plugin-sdk 0.12.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 borgee-plugin-sdk 0.12.1
File Size Uploaded
borgee_plugin_sdk-0.12.1.tar.gz 61.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for borgee-plugin-sdk 0.12.1
File Interpreter ABI Platform
borgee_plugin_sdk-0.12.1-py3-none-any.whl Python 3 none any Details

Total release size: 100.2 kB

Release files / borgee_plugin_sdk-0.12.1.tar.gz

Download URL borgee_plugin_sdk-0.12.1.tar.gz
Size 61.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e6a70cd072255527bfb1839c15953b55043e32a0b4a7539278747d582db15ea5
BLAKE2b-256 checksum
How to use checksums
346f7a9f84d5cb95274f0f24ea60129630a4cc6f5c533cd16a0ac22c804d4498
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / borgee_plugin_sdk-0.12.1-py3-none-any.whl

Download URL borgee_plugin_sdk-0.12.1-py3-none-any.whl
Size 39.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18f9377a1b863787296e70d5a430b1fdcc52e32af914c2e2b89b2819f75370f7
BLAKE2b-256 checksum
How to use checksums
0e0afe4ee422bf10820edd1a4fbc0d505dcfa63d728ccf75247a3831953dc7ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.13.1

2 release files

This release

0.12.1 This release

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.2.0

2 release files

0.1.2

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