https://github.com/artisanofcode/python-quart-injector
Dependency injecetion for quart apps
https://github.com/artisanofcode/python-quart-injector
dependency-injection injector python python-package quart
Last synced: 5 months ago
JSON representation
Dependency injecetion for quart apps
- Host: GitHub
- URL: https://github.com/artisanofcode/python-quart-injector
- Owner: artisanofcode
- Created: 2022-06-03T16:09:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-20T01:06:32.000Z (about 2 years ago)
- Last Synced: 2025-06-29T07:48:42.791Z (6 months ago)
- Topics: dependency-injection, injector, python, python-package, quart
- Language: Python
- Homepage: https://quart-injector.artisan.io
- Size: 431 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Quart Injector
Dependency injecetion for quart apps.
## 🛠 Installing
```
poetry add quart-injector
```
## 🎓 Usage
```py
import typing
import quart
import injector
import quart_injector
Greeting = typing.NewType("Greeting", str)
def configure(binder: injector.Binder) -> None:
binder.bind(Greeting, to="Hello")
app = quart.Quart(__name__)
@app.route("/")
@app.route("/", defaults={"name": "World"})
async def greeting_view(greeting: injector.Inject[Greeting], name: str) -> str:
return f"{greeting} {name}!"
quart_injector.wire(app, configure)
```
## 📚 Help
See the [Documentation][docs] or ask questions on the [Discussion][discussions] board.
## ⚖️ Licence
This project is licensed under the [MIT licence][mit_licence].
All documentation and images are licenced under the
[Creative Commons Attribution-ShareAlike 4.0 International License][cc_by_sa].
## 📝 Meta
This project uses [Semantic Versioning][semvar].
[docs]: https://quart-injector.artisan.io
[discussions]: https://github.com/orgs/artisanofcode/discussions
[mit_licence]: http://dan.mit-license.org/
[cc_by_sa]: https://creativecommons.org/licenses/by-sa/4.0/
[semvar]: http://semver.org/