Skip to main content

bella-baxter

Python SDK for the Bella Baxter secrets management platform. Includes built-in end-to-end encryption and webhook signature verification.

When to use bella-baxter directly

Most applications should use a framework integration instead:

Framework Package
Django bella-baxter-django
FastAPI bella-baxter-fastapi
Flask bella-baxter-flask
Scripts, tools, custom integrations bella-baxter (this package)

Installation

pip install --pre bella-baxter

Quickstart

from bella_baxter import BaxterClient, BaxterClientOptions

client = BaxterClient(BaxterClientOptions(
    baxter_url="https://api.bella-baxter.io",
    api_key="bax-...",
))

# Fetch all secrets (sync — works in Django, Flask, scripts)
secrets = client.get_all_secrets()
db_url = secrets.secrets["DATABASE_URL"]

# Async (FastAPI, asyncio)
secrets = await client.get_all_secrets_async()

Authentication

An API key belongs to one environment. In the Bella WebApp, open the project, choose the Environments tab, open the environment, choose its API Keys tab, then choose Create API Key. The key (bax-<keyId>-<secret>) is shown once, when it is created.

import os
from bella_baxter import BaxterClient, BaxterClientOptions

client = BaxterClient(BaxterClientOptions(
    baxter_url=os.environ["BELLA_BAXTER_URL"],
    api_key=os.environ["BELLA_BAXTER_API_KEY"],
))

API keys encode the project and environment slug — no config file needed. The bella api-keys commands are planned and are not in the CLI yet.

OAuth (local dev)

bella login           # opens browser, stores token in .bella file
bella sdk run -- python app.py   # injects BELLA_BAXTER_API_KEY + BELLA_BAXTER_URL automatically

Writing and deleting secrets

# Create or update one secret (an upsert). `provider` is the provider's slug or UUID and is required.
client.set_secret("RDS_PASSWORD", "s3cr3t", provider="vault-main", description="rotated by CI")

# Delete one. Returns True when it was deleted, False when it was already absent (404).
client.delete_secret("OLD_KEY", provider="vault-main")
  • project_slug and env_slug are optional keyword arguments; they default to the API key's own project and environment. Environments are addressed by slug, never by UUID.
  • Everything after key/value is keyword-only, so a provider can never be passed where a project was meant.
  • Writing needs a Manager API key or higher. A Consumer key is read-only and the API answers 403.
  • A scope-limited key gets 404 from the update when the key does not exist yet; set_secret then creates it (which also stamps the key's scopes on it), as bella secrets set does. Any other error raises.
  • Async variants: set_secret_async() and delete_secret_async().

End-to-end encryption

Secret values are encrypted client-side using ECIES (Elliptic Curve Integrated Encryption Scheme) before being sent to the Baxter API. Decryption happens transparently in the SDK.

E2EE is included — no extra install needed (cryptography>=41 is a core dependency).

Lightweight version polling

For long-running processes that need to detect secret rotations:

# Check if secrets have changed without fetching values
version = client.get_secrets_version()
if version.version != last_known_version:
    secrets = client.get_all_secrets()
    last_known_version = version.version

Webhook signature verification

from bella_baxter import verify_webhook_signature

is_valid = verify_webhook_signature(
    payload=request.body,
    signature_header=request.headers["X-Bella-Signature"],
    secret="whsec-...",
)

Full API access (Kiota client)

# Access the underlying Kiota client for full API coverage
kiota = client.client

# List projects
projects = await kiota.api.v1.projects.get()

# Manage environments, providers, users, API keys, etc.

Regenerating the generated client

bella-baxter embeds a Kiota-generated HTTP client. To regenerate after an API change:

cd apps/sdk
./generate.sh

Metadata

Release files for bella-baxter 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 bella-baxter 0.2.0
File Size Uploaded Provenance Actions
bella_baxter-0.2.0.tar.gz 243.2 kB With provenance Details for bella_baxter-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / bella_baxter-0.2.0.tar.gz

Download URL bella_baxter-0.2.0.tar.gz
Size 243.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7e47db10577a44f894061f5079e9689f45ffbc769ed97c31a20e2005fec845ec
BLAKE2b-256 checksum
How to use checksums
8a116f429c7272f72239ca7560680e84f4d09c72d876edcfa1a5b3ecd75fe08a
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 Nov 26, 2026.

Transparency log

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

Download URL bella_baxter-0.2.0-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
13732e768278b9a5ff7bdb51bba6786b85b062ffc339d6954a23a9da64c76757
BLAKE2b-256 checksum
How to use checksums
396a9dce00ec6813cd0f4e872d0dd836dcba94eb2c8adad305710f90a8f659a1
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 Nov 26, 2026.

Transparency log

Security for bella-baxter 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bella_baxter-0.2.0.tar.gz

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 Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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