Skip to main content

Dependency declarations for Python frameworks and tools

Project description

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.

Project details


Download files

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

Source Distribution

depende-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

depende-0.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: depende-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for depende-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a60decabb3decbfe50fb248cdae13c554217a2c5e74973f180bd9a748daf1102
MD5 4a7a8cbdc5b3118f02cd98b3757e42ce
BLAKE2b-256 e3ab7994211a43d50d5297290ca3e422350e551db32c1121d0ac0a09e8638563

See more details on using hashes here.

File details

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

File metadata

  • Download URL: depende-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for depende-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 24eacfb58d62b4cb9af50cfde8659dcd385bf2fe6e6f29a178a813cbf546a24a
MD5 666f22a3eb7fc19824883f7d26df6f37
BLAKE2b-256 2ce34096b605784cf02dddf21b514084c3fb479d2c42775e946dc54dbaeba8c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page