Skip to main content

Baldur Reliability Layer for Python Applications

Project description

Baldur

Python 3.11+ License: Apache 2.0

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

This repository is a read-only mirror of a private canonical source, published under Apache 2.0. The mirror is re-published by a one-way, history-rewriting sync, so pull requests cannot be merged here — a merge would be overwritten on the next sync. See CONTRIBUTING.md for the full model.

  • Bugs / feature requests / docs → open an issue.
  • 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.0.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.0.0-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: baldur_framework-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 2859b407837169bab9321db2933de81eb81142af5d63bf2a5c0ce648dd4da659
MD5 2a0bf17548707c931079c491b2e7bc1c
BLAKE2b-256 078318ebc30a1b9104e6318bcc34b29577ec5c7af58876acdee974bd043f6c5c

See more details on using hashes here.

Provenance

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

Publisher: build-oss.yml on gotoUSA/baldur-python

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.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for baldur_framework-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1f607cd1ab1d70c7c58f494ee46a0d047f100a27428dda4bfb1129e970311be
MD5 cab9bc583050fb6204d79ffaaa9991bf
BLAKE2b-256 9a80caa366d41b7a06ff5fd334814063e66f8a51f64436f4b2e49e55e32be138

See more details on using hashes here.

Provenance

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

Publisher: build-oss.yml on gotoUSA/baldur-python

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