simple-di
simple dependency injection library
Decision gist · record as of 2026-08-14
Yes, if you need lightweight typed dependency injection for Python 3.6+. The low install friction, permissive license, and active maintenance make it safe to adopt. However, be aware it remains pre-alpha—verify that its feature set and stability match your project's needs before relying on it in production.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with no compiled dependencies.
- The package is actively maintained as of July 2026, though it has been in pre-alpha status since its first release in June 2021.
License · maintenance · safety
Apache License 2.0 (permissive) — Licensed under Apache License 2.0 (permissive), so you can use it freely in commercial and open-source projects with minimal restrictions.
last release 2022-02-22 (1634 days) · last repo commit 2026-07-14 · 21 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 171,836 downloads/mo, #10,352 on PyPI
Alternatives
Verify before relying
pip install simple-di
from simple_di import inject, Provide, Provider, container
from simple_di.providers import Static, Factory
@container
class Options(container):
cpu: Provider[int] = Static(2)
worker: Provider[int] = Factory(lambda c: 2 * c + 1, c=cpu)
@inject
def process(worker: int = Provide[Options.worker]):
return worker
print(process()) # 5- Whether the pre-alpha status reflects incomplete features or simply conservative versioning
- Production readiness and stability guarantees given the 0.1.5 version number
What it is and what it does
simple-di is a dependency injection framework for Python that uses type annotations to wire dependencies into functions and methods. It provides a container pattern where you define providers (Static, Factory, SingletonFactory, Configuration) that compute or store values, then use the @inject decorator to automatically pass those values into function arguments. The library supports runtime value overrides via set() and reset() methods, making it useful for testing and configuration management.
The package depends only on dataclasses and types-dataclasses, keeping the runtime footprint minimal. It supports Python 3.6 through 3.9 and is actively maintained, though it remains in pre-alpha status. The strict typing support means you get IDE autocomplete and type checking for injected dependencies.
Use it for
- Wiring configuration values (database URLs, API keys, feature flags) into application functions without passing them as arguments
- Testing by temporarily overriding provider values without modifying production code
- Building modular applications where components declare their dependencies declaratively rather than instantiating them directly
- Creating factory-based object graphs where computed dependencies depend on other dependencies in a defined order
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need lightweight typed dependency injection for Python 3.6+.
The low install friction, permissive license, and active maintenance make it safe to adopt. However, be aware it remains pre-alpha—verify that its feature set and stability match your project's needs before relying on it in production.
Install
simple-di on PyPI
Before you install
Low friction install with no compiled dependencies. The package is actively maintained as of July 2026, though it has been in pre-alpha status since its first release in June 2021.
License in practice
Licensed under Apache License 2.0 (permissive), so you can use it freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install simple-di
from simple_di import inject, Provide, Provider, container
from simple_di.providers import Static, Factory
@container
class Options(container):
cpu: Provider[int] = Static(2)
worker: Provider[int] = Factory(lambda c: 2 * c + 1, c=cpu)
@inject
def process(worker: int = Provide[Options.worker]):
return worker
print(process()) # 5
Verify before relying
- Whether the pre-alpha status reflects incomplete features or simply conservative versioning
- Production readiness and stability guarantees given the 0.1.5 version number
Package facts
| License | Apache License 2.0 permissive |
| Python support | Supports the current Python release >=3.6.1 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesdataclassestypes-dataclasses |
| Maintenance | Actively maintained 1,634 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 171,836 / month, #10,352 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 2 - Pre-AlphaOperating System :: OS IndependentProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPython |
Evidence: simple_di-0.1.5-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 › “typed di container”
- simple-diA strictly typed dependency injection library that lets you define…
- slackA dependency injection container that registers and provides…
- fast-dependsFastDepends provides a standalone dependency injection system…
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 · in-n-out · kink · fast-depends · rodi · slack · alluka · injector · inject · punq