Registry / devops / rodi
library2.1.0pypypi✓ verified 86d ago

Rodi is a lightweight dependency injection container for Python 3.10+, supporting auto-wiring, singleton and transient lifecycles, and hierarchical containers. Current version is 2.1.0, with regular releases.

pip install rodi
INSTALL
IMPORT
SIG · RODI
R
rodi
devopspythonv2.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Container
from rodi import Container
from rodi.container import Container
The old internal path was changed to a public API in version 2.x.
Singleton
from rodi import Singleton
Commonly available via the top-level module.

Basic registration and resolution of a service.

from rodi import Container class MyService: def greet(self): return "Hello!" container = Container() container.register(MyService) instance = container.resolve(MyService) print(instance.greet())
Debug
Known issues
breakingImport path changes: in version 2.x, public classes like Container are directly importable from 'rodi' instead of submodules.
fix
Use 'from rodi import Container' instead of 'from rodi.container import Container'.
affects: <2.0.0
deprecatedThe method 'register_singleton' is deprecated in favor of 'register' with lifecycle parameter.
fix
Use 'container.register(MyService, lifecycle=Singleton)' instead of 'container.register_singleton(MyService)'.
affects: >=2.0.0
gotchaAuto-wiring may fail if constructor parameters are not registered or have ambiguous types.
fix
Register all dependencies explicitly or use type hints correctly.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'rodi.container'
Trying to import from deprecated submodule in version 2.x.
fix
Use 'from rodi import Container' instead.
rodi.exceptions.ServiceNotRegisteredError: Service not registered
Trying to resolve a type that has not been registered in the container.
fix
Register the type using container.register() before resolving.
Upgrade
Version history
2.1.0latest on PyPI · released Mar 8, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
rodi — pip install rodi · libregistry