Real dependency injection in fastapi
Project description
FastAPI DI
This library to integrate pyject into fastapi to use di
Install
pip install fastapidi
Using
from fastapidi import FastAPIDI, get_dependency
class Test:
def test(self):
return "123"
app = FastAPIDI()
app.container.add_singleton(Test, Test)
@app.get("/")
async def test(dependency: Test = get_dependency(Test)):
return dependency.test()
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
fastapidi-0.1.1.tar.gz
(1.8 kB
view hashes)