Baldur Reliability Layer for Python Applications
Project description
Baldur
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:
- Getting Started — Django, FastAPI, Flask
- Full documentation & concept guides: https://baldur.sh
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 / commercial →
support@baldur.sh.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25b848fc1b85a8d5eac01715fe1e9079ad6028b994f5aa5bfb77190f9bb03567
|
|
| MD5 |
e2d2b9a4b98e7096dc5fd0c73157c69c
|
|
| BLAKE2b-256 |
479380bdf5f42559fae464ac304f455b94abb523594f16a79bf89a56cb08b9ca
|
Provenance
The following attestation bundles were made for baldur_framework-1.1.0.tar.gz:
Publisher:
build-oss.yml on baldurhq/baldur
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baldur_framework-1.1.0.tar.gz -
Subject digest:
25b848fc1b85a8d5eac01715fe1e9079ad6028b994f5aa5bfb77190f9bb03567 - Sigstore transparency entry: 2094558117
- Sigstore integration time:
-
Permalink:
baldurhq/baldur@9e324019faed2773082d865806e60d297107b817 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/baldurhq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-oss.yml@9e324019faed2773082d865806e60d297107b817 -
Trigger Event:
push
-
Statement type:
File details
Details for the file baldur_framework-1.1.0-py3-none-any.whl.
File metadata
- Download URL: baldur_framework-1.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
021dd783a5e8a8e42967225a388b61992fef7b2e956f8a77b54f1032ebefd9eb
|
|
| MD5 |
a24986590332b059f95163a992283d8c
|
|
| BLAKE2b-256 |
88a40609eb1a606684d81bfa373d22aac8048adb517d80160a3779d7df814f88
|
Provenance
The following attestation bundles were made for baldur_framework-1.1.0-py3-none-any.whl:
Publisher:
build-oss.yml on baldurhq/baldur
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baldur_framework-1.1.0-py3-none-any.whl -
Subject digest:
021dd783a5e8a8e42967225a388b61992fef7b2e956f8a77b54f1032ebefd9eb - Sigstore transparency entry: 2094558769
- Sigstore integration time:
-
Permalink:
baldurhq/baldur@9e324019faed2773082d865806e60d297107b817 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/baldurhq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-oss.yml@9e324019faed2773082d865806e60d297107b817 -
Trigger Event:
push
-
Statement type: