Dependency Injection for Humans.
Clone or download
Latest commit 8f4c99e Dec 12, 2018

README.rst

https://raw.githubusercontent.com/dry-python/brand/master/logo/dependencies.png

travis codecov pyup codacy pypi docs gitter


Dependency Injection for Humans

Installation

All released versions are hosted on the Python Package Index. You can install this package with following command.

pip install dependencies

Usage

Dependency injection without dependencies

robot = Robot(
    servo=Servo(amplifier=Amplifier()),
    controller=Controller(),
    settings=Settings(environment="production"),
)

robot.work()

Dependency injection with dependencies

class Container(Injector):
    robot = Robot
    servo = Servo
    amplifier = Amplifier
    controller = Controller
    settings = Settings
    environment = "production"

Container.robot.work()

License

Dependencies library is offered under the two clause BSD license.