Usage scenarios
One service graph across multiple Python entrypoints.
Injex is most useful when application services are reused from more than one place: an API, CLI command, background worker, and test suite.
Wire repositories, gateways, clients, and use cases once at startup. Handlers resolve or receive application services without owning construction logic.
Commands can share settings, API clients, repositories, and services without module-level singletons.
Register long-lived clients as singletons and create one scope per job or message for short-lived state.
Use override() to replace slow or external services with fakes inside one test block.
Startup validation
Add container.assert_valid() to application startup or CI smoke
checks when you want missing registrations and cycles to fail early.
container = build_container()
container.assert_valid()
run_app(container)
These are usage scenarios, not production adoption claims. The docs show where the library fits and where it should stay out of the way.