Skip to content

Bloodielie/fastapidi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

Releases

No releases published

Packages

No packages published

Languages