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.3.tar.gz
(2.1 kB
view details)
File details
Details for the file fastapidi-0.1.3.tar.gz.
File metadata
- Download URL: fastapidi-0.1.3.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09626de1e1630be899765f0b64025fa1bb113e4b0ed90e2d0dd3947661bd4c56
|
|
| MD5 |
9cb3118c0efbbb4dc41bd4429c3087f9
|
|
| BLAKE2b-256 |
8ffba174398cc3b3ec3dbbf8050cb6cd08c7f93d4c284b30c058ce3d8e637ad2
|