Dependency Injection for Humans
Project description
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.
— ⭐️ —
Drylabs maintains dry-python and helps those who want to use it inside their organizations.
Read more at drylabs.io
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dependencies-1.0.1.tar.gz
(14.8 kB
view hashes)
Built Distribution
Close
Hashes for dependencies-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffe1a939eb244bcdf89542ce219d85de1147f45e56e659201e04fde36bfc4b30 |
|
MD5 | d79a139e30a0682c255a1ddf660755fb |
|
BLAKE2b-256 | 3df8006d603d2f5f9a58e54971d15bd2cfadee35ef5e1e20a34225d953e1d7c5 |