Metadata-Version: 2.1
Name: dependable
Version: 0.1.0
Summary: Dependency injection system extracted from FastAPI
Home-page: https://github.com/dmtrs/dependable
License: MIT
Author: Dimitrios Flaco Mengidis 
Author-email: tydeas.dr@gmail.com
Requires-Python: >=3.6.1,<4.0.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: pydantic (>=1.8.1,<2.0.0)
Project-URL: Repository, https://github.com/dmtrs/dependable
Description-Content-Type: text/markdown

<h1 align="center">
    <strong>dependable</strong>
</h1>
<p align="center">
    <a href="https://github.com/dmtrs/dependable" target="_blank">
        <img src="https://img.shields.io/github/last-commit/dmtrs/dependable" alt="Latest Commit">
    </a>
        <img src="https://img.shields.io/github/workflow/status/dmtrs/dependable/Test">
        <img src="https://img.shields.io/codecov/c/github/dmtrs/dependable">
    <br />
    <a href="https://pypi.org/project/dependable" target="_blank">
        <img src="https://img.shields.io/pypi/v/dependable" alt="Package version">
    </a>
    <img src="https://img.shields.io/pypi/pyversions/dependable">
    <img src="https://img.shields.io/github/license/dmtrs/dependable">
</p>

Dependency injection system extracted from `fastapi`

```python
import asyncio
from random import random

from dependable import dependant, Depends

@dependant
async def main(*, choice: int = Depends(random)) -> None:
    print(choice)

asyncio.run(main())
```

More on [examples](examples/tick.py)

## Installation

``` bash
poetry add dependable # pip install dependable
```

## Python 3.6

- Backport require of [async-exit-stack](https://pypi.org/project/async-exit-stack/) and [async_generator](https://pypi.org/project/async_generator/)
```bash
poetry add async-exit-stack async_generator # pip install async-exit-stack async_generator
```

## Development

```bash
docker build -t dependable .
```

```bash
docker run --rm -v $(pwd):/usr/src/app dependable scripts/dev
```

## References

- [tiangolo/fastapi#2967](https://github.com/tiangolo/fastapi/issues/2967)

## License

This project is licensed under the terms of the MIT license.

