injector
Injector - Python dependency injection framework, inspired by Guice
Decision gist · record as of 2026-08-14
Yes. Injector is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It's worth installing if you're building a larger application where dependency injection reduces boilerplate and improves testability; for small scripts or projects where manual dependency passing is simpler, it adds unnecessary overhead.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with a single runtime dependency on typing_extensions.
- The package is actively maintained with a recent release and 1536 repository stars, indicating stable, ongoing support.
License · maintenance · safety
BSD (permissive) — BSD permissive license allows use in most projects, including commercial ones, with minimal restrictions beyond attribution.
last release 2026-01-09 (217 days) · last repo commit 2026-07-11 · 1,536 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,042,933 downloads/mo, #2,391 on PyPI
Alternatives
Verify before relying
pip install injector
from injector import Injector, inject
class Inner:
def __init__(self):
self.forty_two = 42
class Outer:
@inject
def __init__(self, inner: Inner):
self.inner = inner
injector = Injector()
outer = injector.get(Outer)
print(outer.inner.forty_two)- Whether the package supports Python 3.8+ as stated in the description excerpt (requires_python field is unspecified in metadata)
- Whether PyPy 3 support mentioned in the description is actively tested and maintained
What it is and what it does
Injector is a dependency injection framework that automatically wires dependencies into your classes and functions, inspired by Guice but designed for Python idioms. Rather than manually passing dependencies or relying on global state, you declare what your code needs via type hints, and Injector constructs and provides those dependencies for you. It supports scoping like singletons, custom providers, and modular configuration through Module classes, making it particularly useful for decoupling configuration from business logic and reducing boilerplate in larger applications.
The framework emphasizes simplicity and non-intrusiveness: your classes remain standard Python classes that can be instantiated manually if needed, and the framework avoids global state by requiring explicit Injector instances. It cooperates with static type checkers, allowing type-safe dependency retrieval. The main runtime dependency is typing_extensions, making installation straightforward with low friction.
Use it for
- Decoupling configuration and database initialization in web applications or services
- Automatically providing shared resources like database connections to multiple handlers
- Building testable code by swapping real implementations for mocks through different Injector configurations
- Organizing large codebases into modules with clear dependency boundaries and reusable components
- Reducing constructor boilerplate when many classes need the same set of dependencies
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Injector is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It's worth installing if you're building a larger application where dependency injection reduces boilerplate and improves testability; for small scripts or projects where manual dependency passing is simpler, it adds unnecessary overhead.
Install
injector on PyPI
Before you install
Low friction install with a single runtime dependency on typing_extensions. The package is actively maintained with a recent release and 1536 repository stars, indicating stable, ongoing support.
License in practice
BSD permissive license allows use in most projects, including commercial ones, with minimal restrictions beyond attribution.
Quickstart
pip install injector
from injector import Injector, inject
class Inner:
def __init__(self):
self.forty_two = 42
class Outer:
@inject
def __init__(self, inner: Inner):
self.inner = inner
injector = Injector()
outer = injector.get(Outer)
print(outer.inner.forty_two)
Verify before relying
- Whether the package supports Python 3.8+ as stated in the description excerpt (requires_python field is unspecified in metadata)
- Whether PyPy 3 support mentioned in the description is actively tested and maintained
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping_extensions |
| Maintenance | Actively maintained 217 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,042,933 / month, #2,391 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: injector-0.24.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 › “inversion of control”
- injectorInjector is a Python dependency injection framework that…
- slackA dependency injection container that registers and provides…
- simple-diA strictly typed dependency injection library that lets you define…
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 · fastapi-injector · Flask-Injector · inject · kink · pinject · dependencies · slack · in-n-out · simple-di