Skip to main content

Dependency Injection for Humans

Project description

logo

azure-pipeline codecov docs gitter pypi conda-forge 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.

— ⭐️ —

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.

Source Distribution

dependencies-1.0.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dependencies-1.0.1-py2.py3-none-any.whl (23.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dependencies-1.0.1.tar.gz.

File metadata

  • Download URL: dependencies-1.0.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/4.15.0-1071-azure

File hashes

Hashes for dependencies-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a224ef54538c726d38111126d025065a556a08945e35231de5926e6daaf88fa4
MD5 629ca253c200c22318ca26dd44313d95
BLAKE2b-256 28c3d76c1cea8e4e977b4de86ba454b5b5abdc4776e0f5bc287233a569802596

See more details on using hashes here.

File details

Details for the file dependencies-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: dependencies-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/4.15.0-1071-azure

File hashes

Hashes for dependencies-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ffe1a939eb244bcdf89542ce219d85de1147f45e56e659201e04fde36bfc4b30
MD5 d79a139e30a0682c255a1ddf660755fb
BLAKE2b-256 3df8006d603d2f5f9a58e54971d15bd2cfadee35ef5e1e20a34225d953e1d7c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page