Skip to main content

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

Metadata

Release files for fastapidi 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastapidi 0.1.3
File Size Uploaded
fastapidi-0.1.3.tar.gz 2.1 kB Details

Release files / fastapidi-0.1.3.tar.gz

Download URL fastapidi-0.1.3.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
09626de1e1630be899765f0b64025fa1bb113e4b0ed90e2d0dd3947661bd4c56
BLAKE2b-256 checksum
How to use checksums
8ffba174398cc3b3ec3dbbf8050cb6cd08c7f93d4c284b30c058ce3d8e637ad2
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.3 This release

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page