Skip to main content

Rudimentary dependency Injection framework

Project description

A rudimentary Dependency injection framework in python.

The dependencies are defined in a yaml file as mentioned below. Th objects are created by referring to the namespace defined in yaml for the desired object.

Main modules are:

  • jtk.di.dye

Sample Code:

dye.load_di('pydi.yaml')

s = dye.get_instance('jubin.body')

s.print()
  • main.py

Objects created can also reference other objects.

Config file

  • pydi.yaml

Comes in this format:

namespace1:
  class: class_name
  class_attr:
    attr: value
  const_args:
    attr: value
    attr: 'ref:namespace2'
  inst_attr:
    attr: value
    attr: value

namespace2:
  class: class_name
  const_args:
    attr: value

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

pyDye-7.10.0b1.tar.gz (3.0 kB view hashes)

Uploaded Source

Supported by

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