Documentation
Typed dependency injection for small Python apps.
Injex wires services, CLIs, workers, and tests with regular Python type hints, explicit registrations, scoped lifetimes, overrides, and startup validation.
Start
Getting started
Install, register services, validate the graph, resolve use cases.
Safety
Graph validation
Find missing registrations and cycles before services are built.
Decision
Comparison guide
Choose between manual wiring, framework DI, Injex, and larger containers.
Reference
API reference
Container methods, scopes, overrides, validation, and exceptions.
Guide
Python dependency injection
Understand when DI helps in Python and how Injex stays small.
Article
Why tiny Python DI
A shareable article about explicit wiring for Python services.
Install
pip install injex
Best fit
- Service layers reused by API handlers, CLIs, workers, and tests.
- Clean architecture code that should not depend on a web framework.
- Tests that need temporary dependency overrides.
- Startup checks that should validate the dependency graph early.
Rule of thumb: keep container calls at the composition root. Application services should depend on normal Python types.