A pythonic dependency injection library for Python, inspired by Guice. Current version is 0.15.3 (last release on PyPI 0.14.1 but GitHub has 0.15.3). Development appears to be in maintenance mode with no recent releases.
pip install pinjectNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic injection: MyClass depends on DepClass; Pinject automatically injects the dependency.
Use Python 3.11 or earlier, or switch to an actively maintained DI library like 'inject' or 'dependency-injector'.
Replace @pinject.injectable with @pinject.inject() (note the parentheses).
If you relied on default method names like 'configure', they still work. Only breaking if you overrode them and expected the old behavior.
Use @pinject.inject() instead of @pinject.injectable.
Make sure you import correctly: from pinject import new_object_graph
Use @pinject.inject() (with parentheses) on the __init__ method.
No dependency data recorded yet.