fastapi-pypendency
Pypendency integration with FastAPI.
Based on
Installation
pip install fastapi-pypendency
Usage
Configure your FastAPI app with the Pypendency class:
import os
from fastapi import FastAPI
from fastapi_pypendency import Pypendency
app = FastAPI()
Pypendency(
app,
"_dependency_injection",
[os.path.dirname(os.path.abspath(__file__))], # ["src"],
)
A sample controller:
# get_user_controller.py
class GetUserController:
def get(self) -> dict:
return {"user": "John Doe"}
# _dependency_injection/get_user_controller.yaml
GetUserController:
fqn: get_user_controller.GetUserController
On your router:
from fastapi import APIRouter
from fastapi import Request
from fastapi_pypendency import ContainerBuilder
from fastapi_pypendency import get_container
from get_user_controller import GetUserController
router = APIRouter(
prefix="/user",
tags=["user"],
dependencies=[],
responses={404: {"description": "Not found"}},
)
@router.get("/")
def get_user(request: Request):
container: ContainerBuilder = get_container(request)
controller: GetUserController = container.get("GetUserController")
return controller.get()
Metadata
Release files for fastapi-pypendency 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fastapi_pypendency-0.1.3.tar.gz | 3.4 kB | Without provenance | Details for fastapi_pypendency-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastapi_pypendency-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for fastapi_pypendency-0.1.3-py3-none-any.whl |
Total release size: 7.0 kB
Release files / fastapi_pypendency-0.1.3.tar.gz
| Download URL | fastapi_pypendency-0.1.3.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffabb3af0ed64b825cb2785f5d02bbab118e6044ac1f0d7ac01de45235d4340e
|
|
BLAKE2b-256 checksum How to use checksums |
dfb6744f43836af18afa12ef4391683c6fe9c16f509b284eadd014cbd819b442
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / fastapi_pypendency-0.1.3-py3-none-any.whl
| Download URL | fastapi_pypendency-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2fb5962d086e396a5f5e200c46d71bb1a145c62b62b07b3ae34a1314f78bb1c
|
|
BLAKE2b-256 checksum How to use checksums |
2b8ced8758ade28b92bb1f09a0360e68be3f25d729ce8d05e51b9c89d8e8be0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for fastapi-pypendency 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.