Use type hints to declare what a class needs. The framework uses these hints to "look up" the correct dependency.
: The library is commonly used to simplify SOLID principles in frameworks like Django and FastAPI . injector.py
If you have multiple implementations for one interface (e.g., a "TestDB" and a "LiveDB"), use a Module to specify which one to use. Use type hints to declare what a class needs
: Use the @provider decorator inside a Module for more complex object creation that requires logic. a "TestDB" and a "LiveDB")
A guide to implementing injector.py revolves around three main abstractions: