Skip to main content

Depende

Dependency declarations for Python frameworks and tools.

Test Publish Python package version


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.

Install

uv add depende

Or if using pip:

pip install depende

Usage

from depende import Depends, DependsInfo

Depends(...) returns a frozen DependsInfo metadata object with:

  • dependency: a callable dependency, or None
  • use_cache: whether a framework may reuse the dependency result within its active solving context
  • scope: an opaque framework-defined string, or None

The package only declares dependency metadata. It does not solve, execute, cache, inject request data, manage lifecycles, generate OpenAPI, or define framework-specific scopes.

Example

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.

License

This project is licensed under the terms of the MIT license.

Metadata

Release files for depende 0.1.1

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

Source distribution (sdist)

Source distribution for depende 0.1.1
File Size Uploaded
depende-0.1.1.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for depende 0.1.1
File Interpreter ABI Platform
depende-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 kB

Release files / depende-0.1.1.tar.gz

Download URL depende-0.1.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a60decabb3decbfe50fb248cdae13c554217a2c5e74973f180bd9a748daf1102
BLAKE2b-256 checksum
How to use checksums
e3ab7994211a43d50d5297290ca3e422350e551db32c1121d0ac0a09e8638563
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.4 {"installer":{"name":"uv","version":"0.11.4","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 / depende-0.1.1-py3-none-any.whl

Download URL depende-0.1.1-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24eacfb58d62b4cb9af50cfde8659dcd385bf2fe6e6f29a178a813cbf546a24a
BLAKE2b-256 checksum
How to use checksums
2ce34096b605784cf02dddf21b514084c3fb479d2c42775e946dc54dbaeba8c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.4 {"installer":{"name":"uv","version":"0.11.4","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.1 This release

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