Skip to content

FreeElephants/python-di

Repository files navigation

fe-python-di

Simple python dependency injection implementation.

pip install fe-python-di
from di import DI

di = DI()

# set preconfigured component to container
di[InjectedService] = InjectedService()

# get instance by type name
some_service: SomeYourComponentName = di.get(SomeYourComponentName)