Skip to content
Dependency Injection for Humans.
Branch: master
Clone or download
Latest commit 297912c Feb 28, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
src/dependencies Update copyright term. Feb 28, 2019
tests Migrate to poetry. Feb 28, 2019
.gitignore
.python-version
.travis.yml
LICENSE Update copyright term. Feb 28, 2019
README.rst
pyproject.toml
setup.cfg
tox.ini Unpin testing deps. Feb 28, 2019

README.rst

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

travis codecov docs gitter pypi black


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.

You can’t perform that action at this time.