Skip to main content
Help us improve Python packaging – donate today!

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 https://github.com/symfony/DependencyInjection

Status: Work In Progress

Usage

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

services:
    fake:
        class: tests.ioc.service.Fake
        arguments:
            - "%foo.bar%"
        kargs:
            param: here a parameter
        calls:
             - [ set_ok, [ false ]]
             - [ set_ok, [ true ], {arg2: "arg"} ]

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

    weak_reference:
        class: tests.ioc.service.WeakReference

Then to use and access a service just do

import ioc

container = ioc.build(['services.yml'])

foo = container.get('foo')

Release history Release notifications

This version
History Node

0.0.16

History Node

0.0.15

History Node

0.0.14

History Node

0.0.13

History Node

0.0.12

History Node

0.0.10

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
ioc-0.0.16.tar.gz (159.2 kB) Copy SHA256 hash SHA256 Source None May 14, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page