An open API service indexing awesome lists of open source software.

https://github.com/modern-python/that-depends

Simple Dependency injection framework for Python
https://github.com/modern-python/that-depends

dependency-injection di ioc ioc-container mocks python

Last synced: 7 days ago
JSON representation

Simple Dependency injection framework for Python

Awesome Lists containing this project

README

        

"That Depends"
==
[![Test Coverage](https://codecov.io/gh/modern-python/that-depends/branch/main/graph/badge.svg)](https://codecov.io/gh/modern-python/that-depends)
[![MyPy Strict](https://img.shields.io/badge/mypy-strict-blue)](https://mypy.readthedocs.io/en/stable/getting_started.html#strict-mode-and-configuration)
[![Supported versions](https://img.shields.io/pypi/pyversions/that-depends.svg)](https://pypi.python.org/pypi/that-depends)
[![downloads](https://img.shields.io/pypi/dm/that-depends.svg)](https://pypistats.org/packages/that-depends)
[![GitHub stars](https://img.shields.io/github/stars/modern-python/that-depends)](https://github.com/modern-python/that-depends/stargazers)
[![libs.tech recommends](https://libs.tech/project/773446541/badge.svg)](https://libs.tech/project/773446541/that-depends)

Dependency injection framework for Python.

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).
- 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
```bash
pip install that-depends
```

## 📚 [Documentation](https://that-depends.readthedocs.io)

## 📦 [PyPi](https://pypi.org/project/that-depends)

## 📝 [License](LICENSE)