Skip to content

modern-python/that-depends

Repository files navigation

"That Depends"

Test Coverage MyPy Strict pyrefly Supported versions PyPI Downloads GitHub stars libs.tech recommends llms.txt

Dependency injection framework for Python.

Starting a new project? Also consider modern-di, the newer DI framework from the same author with a smaller core and per-framework integration packages. that-depends remains fully supported — see Ecosystem below.

It is production-ready and gives you the following:

  • Simple async-first DI framework with IOC-container.
  • Python 3.10+ support.
  • Full coverage by types annotations (mypy in strict mode, pyrefly).
  • Inbuilt FastAPI, FastStream and LiteStar compatibility.
  • Dependency context management with scopes.
  • Overriding dependencies for tests.
  • Injecting dependencies in functions and coroutines without wiring.
  • Package with zero dependencies.

Installation

pip install that-depends

Ecosystem

that-depends is part of the modern-python family. If you're starting a new project, consider modern-di — the newer DI framework from the same author, with separate framework adapters:

that-depends remains actively maintained — see the migration guide if you want to move existing projects across.

📦 PyPi

📝 License

Contributors