Skip to content

dos-me/dependencies

 
 

Repository files navigation

logo

azure-pipeline 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

>>> from examples import Robot, Servo, Amplifier, Controller, Settings

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

>>> robot.work()

Dependency injection with dependencies

>>> from dependencies import Injector

>>> 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.

About

Dependency Injection for Humans.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%