dependency_injector.wiring

Wiring module.

dependency_injector.wiring.wire(container: Any, *, modules: Iterable[ModuleType] | None = None, packages: Iterable[ModuleType] | None = None) None

Wire container providers with provided packages and modules.

dependency_injector.wiring.unwire(*, modules: Iterable[ModuleType] | None = None, packages: Iterable[ModuleType] | None = 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() TypeModifier

Return int type modifier.

dependency_injector.wiring.as_float() TypeModifier

Return float type modifier.

dependency_injector.wiring.as_(type_: Type) TypeModifier

Return custom type modifier.

dependency_injector.wiring.required() RequiredModifier

Return required modifier.

dependency_injector.wiring.invariant(id: str) InvariantModifier

Return invariant modifier.

dependency_injector.wiring.provided() ProvidedInstance

Return provided instance modifier.

class dependency_injector.wiring.Provide(provider: Provider | Any | str, modifier: Modifier | None = None)
class dependency_injector.wiring.Provider(provider: Provider | Any | str, modifier: Modifier | None = None)
class dependency_injector.wiring.Closing(provider: Provider | Any | str, modifier: Modifier | None = 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.