rodi
Implementation of dependency injection for Python 3
Decision gist · record as of 2026-08-14
Yes. Rodi is actively maintained, has no external dependencies, supports modern Python versions (3.10+), carries a permissive MIT license, and solves a real problem for applications that need structured dependency management. It is particularly valuable in web frameworks and larger applications where service lifecycle management matters. No known security vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction install with no runtime dependencies.
- Active maintenance as of 2026-03-08 with 239 repository stars.
License · maintenance · safety
permissive license (permissive) — MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and proprietary projects.
last release 2026-03-08 (159 days) · last repo commit 2026-03-08 · 239 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 85,380 downloads/mo, #13,925 on PyPI
Alternatives
Verify before relying
pip install rodi
from rodi import Container
container = Container()
container.register(MyService)
service = container.resolve(MyService)- Whether type resolution handles forward references and string annotations correctly
- Performance characteristics when resolving deeply nested dependency graphs
- Compatibility with async/await patterns in service initialization
What it is and what it does
Rodi implements a dependency injection container that builds an object graph by inspecting type hints and class annotations at runtime, then generates efficient resolver functions to instantiate services on demand. It supports three service lifestyles: singleton (one instance per container), transient (new instance each time), and scoped (one instance per resolution call). The container is designed to be configured once at application startup and left unchanged during normal execution, making it suitable for web frameworks and other long-running applications.
The library operates without requiring changes to existing class source code—it reads constructor signatures and annotations to infer dependencies automatically. It validates the dependency graph when building resolver functions (detecting circular dependencies or missing services upfront), so runtime resolution has minimal overhead. Rodi offers both a generic protocol-based API for swappable DI implementations and a concrete implementation for direct use.
Use it for
- Bootstrap a web application with centralized service registration and inject dependencies into request handlers
- Build a CLI tool that instantiates command handlers with their required services registered once at startup
- Create a plugin architecture where services are registered dynamically and resolved by type when plugins are loaded
- Manage database connections, loggers, and configuration objects as singletons across an application
- Test application code by registering mock or stub services in place of real implementations
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Rodi is actively maintained, has no external dependencies, supports modern Python versions (3.10+), carries a permissive MIT license, and solves a real problem for applications that need structured dependency management. It is particularly valuable in web frameworks and larger applications where service lifecycle management matters. No known security vulnerabilities.
Install
rodi on PyPI
Before you install
Low friction install with no runtime dependencies. Active maintenance as of 2026-03-08 with 239 repository stars. Supports Python 3.10 through 3.14.
Requires Python 3.10 or later.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and proprietary projects.
Quickstart
pip install rodi
from rodi import Container
container = Container()
container.register(MyService)
service = container.resolve(MyService)
Verify before relying
- Whether type resolution handles forward references and string annotations correctly
- Performance characteristics when resolving deeply nested dependency graphs
- Compatibility with async/await patterns in service initialization
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 159 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 85,380 / month, #13,925 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: rodi-2.1.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “service container type hints”
- rodiRodi is a dependency injection container for Python that resolves and…
- allukaAlluka is a type-based dependency injection framework that uses…
- lagomLagom is a lightweight dependency injection container that auto-wires…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also dependency-injector · dishka · punq · wireup · alluka · simple-di · slack · lagom · dependencies · taskiq-dependencies