Skip to main content

A small dependency injection container based on Symfony2 Dependency Component

Project description

This project is a simple port of the Symfony2 DependencyInjection lib available at

Status: Work In Progress


  • Create a services.yml file, the file will contains different service definiton such as
parameters: argument 1

        class: tests.ioc.service.Fake
            - ""
            param: here a parameter
             - [ set_ok, [ false ]]
             - [ set_ok, [ true ], {arg2: "arg"} ]

        class: tests.ioc.service.Foo
        arguments: ["@fake", "#@weak_reference"]
        kargs: {}

        class: tests.ioc.service.WeakReference

Then to use and access a service just do

import ioc

container =['services.yml'])

foo = container.get('foo')

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 ioc, version 0.0.16
Filename, size File type Python version Upload date Hashes
Filename, size ioc-0.0.16.tar.gz (159.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page