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.2.tar.gz (12.3 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.2-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deadline_budget-0.1.2.tar.gz
  • Upload date:
  • Size: 12.3 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.2.tar.gz
Algorithm Hash digest
SHA256 bb53847c85a7bfe3d4399ce1a0c310a93904d979a5586626fc97bb8eaf55bfdd
MD5 336beb86b96dd4e18a5403129d9535e0
BLAKE2b-256 0f05b8f3a883b0f0e19b11f9af7fee7775ed5226cf48803641d3020808e6bb66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deadline_budget-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a673d849d134acb072bd6fcc575af0b1478b45a1db7551121021da4873e2098
MD5 1cb10bbed151713b04a5c667e4e51105
BLAKE2b-256 6964ac879e5c01da6bd004fb9859a10a6cfa1957f54f7cb4afa73c667e11ead7

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

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