dependency_injector.wiring

Wiring module.

dependency_injector.wiring.wire(container: Any, *, modules: Optional[Iterable[module]] = None, packages: Optional[Iterable[module]] = None) → None

Wire container providers with provided packages and modules.

dependency_injector.wiring.unwire(*, modules: Optional[Iterable[module]] = None, packages: Optional[Iterable[module]] = None) → None

Wire provided packages and modules with previous wired providers.

dependency_injector.wiring.inject(fn: F) → F

Decorate callable with injecting decorator.

dependency_injector.wiring.as_int() → dependency_injector.wiring.TypeModifier

Return int type modifier.

dependency_injector.wiring.as_float() → dependency_injector.wiring.TypeModifier

Return float type modifier.

dependency_injector.wiring.as_(type_: Type) → dependency_injector.wiring.TypeModifier

Return custom type modifier.

dependency_injector.wiring.required() → dependency_injector.wiring.RequiredModifier

Return required modifier.

dependency_injector.wiring.invariant(id: str) → dependency_injector.wiring.InvariantModifier

Return invariant modifier.

dependency_injector.wiring.provided() → dependency_injector.wiring.ProvidedInstance

Return provided instance modifier.

class dependency_injector.wiring.Provide(provider: Union[dependency_injector.providers.Provider, Any, str], modifier: Optional[dependency_injector.wiring.Modifier] = None)
class dependency_injector.wiring.Provider(provider: Union[dependency_injector.providers.Provider, Any, str], modifier: Optional[dependency_injector.wiring.Modifier] = None)
class dependency_injector.wiring.Closing(provider: Union[dependency_injector.providers.Provider, Any, str], modifier: Optional[dependency_injector.wiring.Modifier] = None)
dependency_injector.wiring.register_loader_containers(*containers: Any) → None

Register containers in auto-wiring module loader.

dependency_injector.wiring.unregister_loader_containers(*containers: Any) → None

Unregister containers from auto-wiring module loader.

dependency_injector.wiring.install_loader() → None

Install auto-wiring module loader hook.

dependency_injector.wiring.uninstall_loader() → None

Uninstall auto-wiring module loader hook.

dependency_injector.wiring.is_loader_installed() → bool

Check if auto-wiring module loader hook is installed.