This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Simple Dependency Injection Container inspired by Pimple.


Using pip:

# pip install rumple


$ git clone
$ cd rumple
# python install


from rumple import Container

c1 = Container()
c2 = Container({
    'param': 'value',
    'service': lambda: object()

Defining services

from rumple import Container

class Service(object):

class AnotherService(object):
    def __init__(self, service):
        self.service = service

container = Container()
container['service'] = lambda: Service()
container['another_service'] = lambda c: AnotherService(c['service'])
another_service = container['another_service']
assert isinstance(another_service, AnotherService)
assert another_service.service is container['service']

Defining parameters

from rumple import Container

container = Container()
container['parameter'] = 'value'
assert container['parameter'] == 'value'

Extending services

from rumple import Container

class Service(object):
    def __init__(self):
        self.optional_dependency = None

    def set_optional_dependency(self, dependency):
        self.optional_dependency = dependency

class OptionalDependency(object):

def extend_service(service, container):  # Note: you can omit "container" argument
    return service

container = Container()
container['service'] = lambda: Service()
container['optional_dependency'] = lambda: OptionalDependency()
container.extend('service', extend_service)


from rumple import Container, extend, share, value

class Provider(object):
    def service(self):
        return object()

    def another_service(self):
        return object()

    def service_for_extend(self):
        return object()

    def first_option(self):
        return 'value_1'

    def second_option(self):
        return 'value_2'

    def _ignored(self):
        return 'value'

class AnotherProvider(object):
    def extend_service(self, service_for_extend):
        assert isinstance(service_for_extend, object)
        return str(object)

container = Container()
assert isinstance(container['service'], object)
assert isinstance(container['renamed_service'], object)
assert isinstance(container['service_for_extend'], str)
assert container['first_option'] == 'value_1'
assert container['second_option_renamed'] == 'value_2'
assert '_ignored' not in container

Iterating through a container

from rumple import Container

container = Container({'k1': 'v1', 'k2': 'v2'})
for item in container:

# Output:
# ('k1', 'v1')
# ('k2', 'v2')


0.1.0 (15.07.2015)

  • First release


  • Fork and clone it
  • Create your feature branch (git checkout -b awesome-feature)
  • Make your changes
  • Write/update tests, if it’s necessary
  • Update, if it’s necessary
  • Push your branch (git push origin awesome-feature)
  • Send a pull request


The MIT License (MIT)

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
rumple-0.1.0.tar.gz (3.6 kB) Copy SHA256 Checksum SHA256 Source Jul 14, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting