Skip to content

Latest commit

Β 

History

History
59 lines (37 loc) Β· 1.2 KB

File metadata and controls

59 lines (37 loc) Β· 1.2 KB

Quart Injector

Dependency injecetion for quart apps.

πŸ›  Installing

poetry add quart-injector

πŸŽ“ Usage

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("/<name>")
@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 or ask questions on the Discussion board.

βš–οΈ Licence

This project is licensed under the MIT licence.

All documentation and images are licenced under the Creative Commons Attribution-ShareAlike 4.0 International License.

πŸ“ Meta

This project uses Semantic Versioning.