Python dependency injection framework, inspired by Guice
https://github.com/alecthomas/injector
Dependency injection as a formal pattern is less useful in Python than
in other languages, primarily due to its support for keyword
arguments, the ease with which objects can be mocked, and its dynamic
nature.
That said, a framework for assisting in this process can remove a lot
of boiler-plate from larger applications. That's where Injector can
help. It automatically and transitively provides keyword arguments
with their values. As an added benefit, Injector encourages nicely
compartmentalised code through the use of Module s.
While being inspired by Guice, it does not slavishly replicate its
API. Providing a Pythonic API trumps faithfulness.
- Sources inherited from project devel:languages:python
- Devel package for openSUSE:Factory
-
1
derived packages
- Links to openSUSE:Factory / python-injector
- Download package
-
Checkout Package
osc -A https://api.opensuse.org checkout home:smarty12:Python/python-injector && cd $_
- Create Badge
Refresh
Refresh
Source Files
Filename | Size | Changed |
---|---|---|
0.16.2.tar.gz | 0000180603 176 KB | |
_link | 0000000124 124 Bytes | |
python-injector.changes | 0000001036 1.01 KB | |
python-injector.spec | 0000002340 2.29 KB |
Revision 5 (latest revision is 20)
Tomáš Chvátal (scarabeus_iv)
accepted
request 709112
from
Markéta Machová (mcalabkova)
(revision 5)
- update to version 0.16.2 * Added support for overriding injectable parameters with positional arguments (previously only possible with keyword arguments) * Fixed crashes caused by typed self in method signatures * Dropped Python 3.4 support * Removed previously deprecated constructs: with_injector, Injector.install_into, Binder.bind_scope * Dependencies are no longer injected into Module.configure and raw module functions * Removed unofficial support for injecting into parent class constructors
Comments 0