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
# slack

a DI Container

## register and provide

```python
from slack import Container

c = Container()

class Component:
def __init__(self):
pass

c.register('component', Component)

c1 = c.provide('component')
c2 = c.provide('component') # c1 is c2
```

## dependency inject

```python
class Component:
def __init__(self, dep1, dep2):
pass

c.register('dep1', Dep1)
c.register('dep2', Dep2)
c.register('component', Component)
c.provide('component')
```

## partial inject

```python
class Component:
def __init__(self, dep1, dep2):
pass

NewComponent = c.inject(Component, 'dep1')

c = NewComponent(dep2)
```

## using decorator

```python
c.register('comp1')
def comp1(dep1, dep2):
return SomeClass()
```

## apply

```python
def fn(a, b):
pass

@c.register('b')
def provide_b():
pass

c.apply(fn, a=val)
```

## groups and reset

```python
@c.register('comp', group='once')
class Component:
pass

comp1 = c.provide('comp')
comp2 = c.provide('comp') # comp1 is comp2

c.reset('once')

comp3 = c.provide('comp') # comp3 is not comp2
```
Release History

Release History

0.0.3

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

0.0.2

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

0.0.1

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

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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