A lightweight library with an implementation of IoC
Project description
# Simple IoC
[](https://travis-ci.org/agroptima/simple-ioc)
[](https://opensource.org/licenses/GPL-3.0)

## Install
```
$ pipenv install simple-ioc
```
or
```
$ pip install simple-ioc
```
## Usage
In order to have the IoC (Inversion of Control) working in your application, you must register your services in the IoC container:
```python
from simple_ioc import Container
class AService:
# Your service implementation comes here
Container().register('an_identifier', lambda: AService())
```
Then, from any point in your application, you can retrieve the service by calling `get`:
```python
a_service = Container().get('an_identifier')
```
[](https://travis-ci.org/agroptima/simple-ioc)
[](https://opensource.org/licenses/GPL-3.0)

## Install
```
$ pipenv install simple-ioc
```
or
```
$ pip install simple-ioc
```
## Usage
In order to have the IoC (Inversion of Control) working in your application, you must register your services in the IoC container:
```python
from simple_ioc import Container
class AService:
# Your service implementation comes here
Container().register('an_identifier', lambda: AService())
```
Then, from any point in your application, you can retrieve the service by calling `get`:
```python
a_service = Container().get('an_identifier')
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simple-ioc-3.0.tar.gz
(2.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
simple_ioc-3.0-py3-none-any.whl
(14.9 kB
view details)
File details
Details for the file simple-ioc-3.0.tar.gz.
File metadata
- Download URL: simple-ioc-3.0.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64a4afda1020d501fc8ec59a2d3d3f6a6a1cae16b9d76ac69cf5288c0f66ea62
|
|
| MD5 |
1d177c30149758b3ccced3101fd40369
|
|
| BLAKE2b-256 |
d5996bf7da624eec70718d7a3b54606dd59f69a1d24b2bd05d7919e992c58371
|
File details
Details for the file simple_ioc-3.0-py3-none-any.whl.
File metadata
- Download URL: simple_ioc-3.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd9d5295781210f7390c8a729ec480477238b6e0fb54cf0f0c74f863ca4f84ff
|
|
| MD5 |
e79329b4cf4adbc3ed8672fd5f7f1d07
|
|
| BLAKE2b-256 |
0c7e51934ffb497a521d32cb8527ca05a3b899d0711828310083cf8c8ab00fe7
|