About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

linux default iconinjector Publisher's description

Injector - Python dependency injection framework, inspired by Guice

Injector - Python dependency injection framework, inspired by Guice

This framework is also similar to snake-guice, but aims for simplification.

While being inspired by Guice, it does not slavishly replicate its API. Providing a Pythonic API trumps faithfulness.
An Example

TODO: Write a more useful example.

Here's a brief, completely contrived, example from the unit tests:

from injector import Injector, Module, Key, injects, provides

Weight = Key('Weight')
Age = Key('Age')
Description = Key('Description')

class MyModule(Module):
def provide_weight(self):
return 50.0

def provide_age(self):
return 25

@inject(age=Age, weight=Weight)
def provide_description(self, age, weight):
return 'Bob is %d and weighs %0.1fkg' % (age, weight)

injector = Injector(MyModule())
assert_equal(injector.get(Description), 'Bob is 25 and weighs 50.0kg')

System Requirements:

No special requirements.
Program Release Status:
Program Install Support: Install and Uninstall

Is injector your software?

Manage your software

Most Popular

linux default icon GDB 7.4
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it... Read more
linux default icon Coral 0.9.1
Coral is a tool and a development platform to create and transform models and modeling languages.
linux default icon Forum Paid Plus Script 6.1
Forum Paid Pay Per Post Exchange is targeted at forum owners who wish to...
linux default icon sdo 0.6.5
Converts oracle SDO_GEOMETRY objects to WKT and GeoJSON.
linux default icon Get Paid Plus Script 6.1
Get Paid Plus Script

Related Category

» Other (877)
» Tools & Editors (359)
» Web Development (146)