deadline-budget
Request deadline budget tracking for distributed orchestrations
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)
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb53847c85a7bfe3d4399ce1a0c310a93904d979a5586626fc97bb8eaf55bfdd
|
|
| MD5 |
336beb86b96dd4e18a5403129d9535e0
|
|
| BLAKE2b-256 |
0f05b8f3a883b0f0e19b11f9af7fee7775ed5226cf48803641d3020808e6bb66
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a673d849d134acb072bd6fcc575af0b1478b45a1db7551121021da4873e2098
|
|
| MD5 |
1cb10bbed151713b04a5c667e4e51105
|
|
| BLAKE2b-256 |
6964ac879e5c01da6bd004fb9859a10a6cfa1957f54f7cb4afa73c667e11ead7
|