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.

License

Apache 2.0 — see LICENSE.

Download files

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

Source Distribution

deadline_budget-0.1.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

deadline_budget-0.1.1-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file deadline_budget-0.1.1.tar.gz.

File metadata

  • Download URL: deadline_budget-0.1.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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}

File hashes

Hashes for deadline_budget-0.1.1.tar.gz
Algorithm Hash digest
SHA256 08c941fe1be7d897a7c5982a018c752ac89ce325a8e5a4c15f2c1a3ae8549ee3
MD5 7a0e647a86490341a4bbc133db3a2cf7
BLAKE2b-256 9b947a9410e01c6eaefc14dda1cd47dc576ccb03e078754e75db79bbce280b7b

See more details on using hashes here.

File details

Details for the file deadline_budget-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: deadline_budget-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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}

File hashes

Hashes for deadline_budget-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3910ab45d2328b75a101dd71aa5a7e7e59d0029810e1739834f2479fd1643867
MD5 05bcce8052526c08bfc42173a165366f
BLAKE2b-256 b4f837f780f13624ae9d1eb8840338f94da20d886d68528614188e9eb3fd15f3

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 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