Skip to main content

Baldur Reliability Layer for Python Applications

Project description

Baldur

Python 3.11+ License: Apache 2.0 PyPI Docs

Baldur is a self-healing reliability layer for Python applications. It puts circuit breaker, retry, and fallback behind a single decorator, so a flaky downstream stops cascading into your service. Durable dead-letter queue, audit, and replay are available in Baldur PRO. The core is framework-agnostic, with first-class adapters for Django, FastAPI, and Flask.

Install

The Python package is baldur (you import baldur); the PyPI distribution is baldur-framework.

pip install baldur-framework                 # framework-agnostic core
pip install baldur-framework[django]         # Django integration
pip install baldur-framework[fastapi]        # FastAPI integration
pip install baldur-framework[flask]          # Flask integration
pip install baldur-framework[celery]         # Celery task protection
pip install baldur-framework[redis]          # Redis-backed shared state
pip install baldur-framework[prometheus]     # Prometheus metrics

Quick example

import baldur


@baldur.protected("charge-customer")
def charge(order_id: str) -> dict:
    # Wrapped in a circuit breaker by default. With zero configuration this
    # runs on an in-memory fallback — no Redis, no env vars, no Docker.
    return payment_gateway.charge(order_id)

@baldur.protected("name") composes circuit breaker, retry, and fallback into one pipeline. Add Redis (pip install baldur-framework[redis], BALDUR_REDIS_URL=...) when you move to multiple workers so the state is shared.

Quickstart

Pick your framework and have a protected endpoint running:

Compatibility

Component Minimum Tested in CI
Python 3.11 3.11 · 3.12 · 3.13
Django 4.2 4.2 LTS · 5.2 LTS · 6.0
FastAPI 0.100 latest ≥ floor (smoke)
Flask 2.3 latest ≥ floor (smoke)
Celery 5.3 5.4
Redis server 7.x

See Compatibility for the full matrix, the diagonal Python × Django test grid, and the version support policy.

Using Baldur with AI assistants

Building with an AI coding assistant (Claude Code, Cursor, Copilot, Codex)? Run baldur init-ai in your repo to drop an AGENTS.md (read by Cursor, Copilot, and Codex) plus a CLAUDE.md that imports it for Claude Code — together they teach the assistant to reach for @baldur.protected("name") instead of hand-rolling a circuit breaker. See Using Baldur with AI assistants.

License

Baldur is released under the Apache License 2.0 — see LICENSE and NOTICE.

Contributing

Contributions are welcome under the Apache License 2.0. Pull requests are accepted through a sign-off-based DCO flow — see CONTRIBUTING.md for the full model.

  • Bugs / feature requests / docs → open an issue or a pull request.
  • Security → see SECURITY.md (no public issues for vulnerabilities).
  • Usage questions / commercialsupport@baldur.sh.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

baldur_framework-1.1.0.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

baldur_framework-1.1.0-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

Details for the file baldur_framework-1.1.0.tar.gz.

File metadata

  • Download URL: baldur_framework-1.1.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for baldur_framework-1.1.0.tar.gz
Algorithm Hash digest
SHA256 25b848fc1b85a8d5eac01715fe1e9079ad6028b994f5aa5bfb77190f9bb03567
MD5 e2d2b9a4b98e7096dc5fd0c73157c69c
BLAKE2b-256 479380bdf5f42559fae464ac304f455b94abb523594f16a79bf89a56cb08b9ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for baldur_framework-1.1.0.tar.gz:

Publisher: build-oss.yml on baldurhq/baldur

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file baldur_framework-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for baldur_framework-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 021dd783a5e8a8e42967225a388b61992fef7b2e956f8a77b54f1032ebefd9eb
MD5 a24986590332b059f95163a992283d8c
BLAKE2b-256 88a40609eb1a606684d81bfa373d22aac8048adb517d80160a3779d7df814f88

See more details on using hashes here.

Provenance

The following attestation bundles were made for baldur_framework-1.1.0-py3-none-any.whl:

Publisher: build-oss.yml on baldurhq/baldur

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page