Skip to main content

A simpler DI Container

Project description

the_rack
========

> A simpler DI Container.

## Install using pip

pip install the_rack

## Usage example

```python
from the_rack import Rack

class Foo: pass

c = Rack()
c['foo'] = lambda get: Foo()

c['foo'] # Foo object

class Bar:
def __init__(self, foo): pass

c['bar'] = lambda get: Bar(get('foo'))

c['bar'] # Bar object

assert c['bar'] == c['bar'] # Caching
```

The complete usage is explained [in the doc](doc.md).

This code is licenced under [the MIT license](https://tleb.mit-license.org/).

Project details


Supported by

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