pinject
A pythonic dependency injection library
What it is and what it does
Pinject is a dependency injection library designed to make object graph assembly straightforward and pythonic. It automatically creates bindings between constructor argument names and class names by following PEP8 conventions—converting CamelCase class names to snake_case argument names—so you can instantiate complex object hierarchies with a single call to new_object_graph() and provide(), without decorators or explicit configuration.
The library depends on six and decorator for compatibility and function wrapping. It includes convenience decorators like @copy_args_to_internal_fields to reduce boilerplate in __init__ methods. However, the project has been archived since 2021 and receives no active maintenance, so it is no longer under active development or receiving updates.
Use it for:
- Assemble complex object graphs in application startup without writing factory methods or configuration code
- Build modular Python applications where components are automatically wired based on constructor signatures
- Reduce boilerplate in __init__ methods using @copy_args_to_internal_fields for classes with many dependencies
- Prototype or develop applications where implicit binding conventions match your code structure
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pinject is a dependency injection library that automatically assembles object graphs by matching constructor argument names to class names, eliminating the need for decorators or explicit configuration.
No. While Pinject is a well-designed, low-friction dependency injection library with permissive licensing and no known vulnerabilities, the project is archived and unmaintained since 2021. For new projects, use an actively maintained alternative like dependency-injector or injector. For existing codebases already using Pinject, it remains functional but will not receive bug fixes or security updates.
Install
pinject on PyPI
pip
pip install pinjectuv
uv add pinjectpoetry
poetry add pinjectInstalling pinject
Before you install
Low friction installation with only two lightweight runtime dependencies (six and decorator). However, the project is archived and has not been updated since 2019, with the last commit in March 2021, so it receives no active maintenance.
License in practice
Licensed under Apache License 2.0 (permissive), allowing use in commercial and private projects with minimal restrictions, though you should include a copy of the license and note any modifications.
Quickstart
pip install pinject
import pinject
class InnerClass:
def __init__(self):
self.value = 42
class OuterClass:
def __init__(self, inner_class):
self.inner_class = inner_class
obj_graph = pinject.new_object_graph()
outer = obj_graph.provide(OuterClass)
print(outer.inner_class.value)
Verify before relying
- Whether the package works reliably with modern Python versions (3.9+) given its age and lack of maintenance
- Compatibility with current versions of runtime dependencies six and decorator
- Whether the archived repository will accept bug reports or security fixes
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — six, decorator |
| Maintenance | abandoned — 2,638 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 125,167/month — #11,834 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pinject-0.14.1-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
injectorInjector is a Python dependency injection…
permissive · top 5,000 on PyPI
injectProvides a lightweight dependency injection…
permissive · top 5,000 on PyPI
slackA dependency injection container that registers…
permissive · top 15,000 on PyPI
in-n-outLightweight dependency injection framework…
permissive · top 15,000 on PyPI
dependency-injectorDependency Injector is a dependency injection…
permissive · top 5,000 on PyPI
objectgraphObjectgraph provides a Python class for…
permissive · top 15,000 on PyPI
kinkKink is a lightweight dependency injection…
permissive · top 15,000 on PyPI
wireupWireup is a type-driven dependency injection…
permissive · top 15,000 on PyPI
dependenciesImplements constructor injection for dependency…
permissive · top 15,000 on PyPI
simple-diA strictly typed dependency injection library…
permissive · top 15,000 on PyPI