Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmtrs/dependable
Dependency injection system extracted from FastAPI
https://github.com/dmtrs/dependable
Last synced: about 2 months ago
JSON representation
Dependency injection system extracted from FastAPI
- Host: GitHub
- URL: https://github.com/dmtrs/dependable
- Owner: dmtrs
- License: mit
- Created: 2021-03-25T22:50:55.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-03T20:49:53.000Z (almost 4 years ago)
- Last Synced: 2024-08-09T02:58:06.476Z (5 months ago)
- Language: Python
- Size: 144 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
dependable
Dependency injection system extracted from `fastapi`
```python
import asyncio
from random import randomfrom 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.