Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Buddy Python SDK

After registry publication, install with:

pip install --pre usebuddy

Server-side Python 3.9+ client with no runtime dependencies.

import os
from buddy import Buddy

buddy = Buddy(os.environ["BUDDY_API_KEY"])
account = buddy.me()
buddy.subscribers.create({"phone": "+15550000001", "name": "Amira"})
message = buddy.messages.send({
    "to": "+15550000001",
    "template": "buddy_test_hello",
    "variables": ["Amira"],
}, idempotency_key="my-first-test-message")
print(message["data"]["id"])

Use a test key for this example. Every operation is also available by its OpenAPI operation ID: buddy.call("getMessage", path={"id": message_id}). Use buddy.paginate("listSubscribers", query={"limit": 50}) to iterate all pages.

POST calls create one idempotency key and retain it across bounded retries. Supply a stable key for retries across process restarts. PATCH is not retried. Redirects are refused so credentials are never forwarded to a new location. Replayed server failures are surfaced immediately; never change the key to bypass an uncertain outcome.

Catch BuddyError for status, code, request_id, details and retry_after. SubscriberOptedOut and TemplateNotApproved allow specific handling. Verify webhooks with verify_webhook(raw_bytes, signature_header, signing_secret) before parsing or acting on them. Deduplicate event IDs durably.

Run tests with PYTHONPATH=packages/python python3 -m unittest discover -s packages/python/tests. Install locally using python3 -m pip install ./packages/python in a virtual environment. Package publication requires verified registry ownership.

Every OpenAPI operation also has a generated snake_case method, such as buddy.send_message(body={...}) and buddy.get_subscriber(id="sub_..."). Request and response TypedDict models are exported from buddy.models. Generate both SDKs from the contract with node scripts/generate-sdk.mjs.

Resource helpers include subscribers, messages, templates, events, otp, campaigns and webhooks. Generated snake_case operation methods cover every API endpoint. Safe requests retry network failures, non-JSON gateway errors, rate limits and request_in_progress within max_retries (default 2), retaining the original body and idempotency key. Replayed failures are not retried.

For writes that must survive a process restart or exhausted retry budget, supply and persist your own stable idempotency key before the first call. Automatically generated keys are retained only within that call; a fresh SDK call generates another key.

Metadata

Release files for usebuddy 0.1.0b1

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

Source distribution (sdist)

Source distribution for usebuddy 0.1.0b1
File Size Uploaded
usebuddy-0.1.0b1.tar.gz 15.4 kB Details

Built distribution (wheel)

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

Total release size: 28.8 kB

Release files / usebuddy-0.1.0b1.tar.gz

Download URL usebuddy-0.1.0b1.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d8b8f6f2ae399d3b577ea1afd69fcd7d3432ff27fe684a4e2b7b31fa70bfacac
BLAKE2b-256 checksum
How to use checksums
6a3b28a6d68bd0c6c1d1f2ed17be4877185e8ec38f965d6938cbe80cab9ab06e
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 Oct 18, 2026.

Transparency log

Release files / usebuddy-0.1.0b1-py3-none-any.whl

Download URL usebuddy-0.1.0b1-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f053f59f08534961411797effa6d8127d61424e8871d3ddaa97a39761f45440
BLAKE2b-256 checksum
How to use checksums
41b6819492ce0856d0cdf329a6d2a2ddc7a2718a3d48489c16e37ed6230e8637
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 Oct 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0b1 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