Dependency declarations for Python frameworks and tools.
Documentation: https://depende.tiangolo.com
Source Code: https://github.com/tiangolo/depende
depende provides small dependency declarations in the style of FastAPI for reuse by frameworks and tools.
uv add dependeOr if using pip:
pip install dependefrom depende import Depends, DependsInfoDepends(...) returns a frozen DependsInfo metadata object with:
dependency: a callable dependency, orNoneuse_cache: whether a framework may reuse the dependency result within its active solving contextscope: an opaque framework-defined string, orNone
The package only declares dependency metadata. It does not solve, execute, cache, inject request data, manage lifecycles, generate OpenAPI, or define framework-specific scopes.
from depende import Depends
from typing import Annotated
def get_settings() -> dict[str, str]:
return {"mode": "prod"}
SettingsDep = Annotated[dict[str, str], Depends(get_settings, scope="command")]Frameworks decide what scope means and how dependency solving works.
This project is licensed under the terms of the MIT license.