Skip to main content

Dependency Injection for Humans

Project description

logo

azure-devops-builds azure-devops-coverage readthedocs gitter pypi conda


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

— ⭐️ —

Drylabs maintains dry-python and helps those who want to use it inside their organizations.

Read more at drylabs.io

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dependencies, version 2.0.0
Filename, size File type Python version Upload date Hashes
Filename, size dependencies-2.0.0-py2.py3-none-any.whl (15.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size dependencies-2.0.0.tar.gz (9.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page