Skip to main content

deadline-budget

Request deadline budget tracking for distributed orchestrations

PyPI Python License CI codecov Docs

Installation

pip install deadline-budget

Optional dependencies:

pip install deadline-budget[settings]  # Pydantic-based settings
pip install deadline-budget[dishka]    # Dishka DI provider

Requirements: Python 3.10+

Quick start

from deadline_budget import BudgetContext

# Define per-call timeout caps
call_caps = {
    "identity_create_user": 3.0,
    "credential_set_password": 3.0,
    "verification_verify_code": 2.0,
}

# Create context with total budget (10s total, 0.5s safety margin = 9.5s usable)
ctx = BudgetContext.create(
    total_seconds=10.0,
    safety_margin=0.5,
    min_timeout=0.1,
    call_caps=call_caps,
)

# Get timeout for each call (uses specific cap or remaining budget)
await identity_service.create_user(..., timeout=ctx.timeout_for_call("identity_create_user"))
await credential_service.set_password(..., timeout=ctx.timeout_for_call("credential_set_password"))
await verification_service.confirm(..., timeout=ctx.timeout_for_call("verification_verify_code"))

# Check if budget exhausted
ctx.check_expired()  # Raises DeadlineExceededError if expired

Documentation

Full documentation at bedrock-python.github.io/deadline-budget.

  • For AI agents — the whole API surface, the rules that break code when broken and a map of the rest, on one page to hand to a coding assistant

License

Apache 2.0 — see LICENSE.

Metadata

Release files for deadline-budget 0.1.3

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

Source distribution (sdist)

Source distribution for deadline-budget 0.1.3
File Size Uploaded
deadline_budget-0.1.3.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deadline-budget 0.1.3
File Interpreter ABI Platform
deadline_budget-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 30.4 kB

Release files / deadline_budget-0.1.3.tar.gz

Download URL deadline_budget-0.1.3.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7c77fe86682036e444cee4194175e331ac20cbe067e305591dc838fc030b01fd
BLAKE2b-256 checksum
How to use checksums
02cabf94e0a74e401594bedef0a54050213a5201596c9077d591a274da1d3fe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / deadline_budget-0.1.3-py3-none-any.whl

Download URL deadline_budget-0.1.3-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be9b29931f6b7a0513bb18e70c236bd192343a10bfe374196a3301c574f3cb69
BLAKE2b-256 checksum
How to use checksums
14a2144e41bacd69008f5bd5301982812b6487e36f6ab28cc9aa9834f39f0647
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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