fastapi-di-chain
Chain FastAPI dependencies without unused Depends!
Overview
fastapi-di-chain provides a utility to chain FastAPI dependencies in a way that avoids
unused Depends parameters, making your dependency injection cleaner,
more maintainable and easier to integrade.
Installation
pip install fastapi-di-chain
Usage
Suppose you have several dependencies that you want to chain together:
from fastapi import FastAPI, Depends
from fastapi_di_chain import DependsChain
app = FastAPI()
def my_rate_limiting_dependency() -> None:
# e.g. checks rate limiting
pass
def my_authentication_dependency() -> None:
# e.g. checks that user is authenticated to do a request
pass
dependency_chain = DependsChain | my_rate_limiting_dependency | my_authentication_dependency
@app.get("/profile", dependencies=[dependency_chain])
def profile() -> dict:
return {"user": 123}
License
fastapi-di-chain is distributed under the terms of the MIT license. Please see License.md for more information.
Metadata
Release files for fastapi-di-chain 0.0.6
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_di_chain-0.0.6.tar.gz | 46.3 kB | Without provenance | Details for fastapi_di_chain-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastapi_di_chain-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for fastapi_di_chain-0.0.6-py3-none-any.whl |
Total release size: 50.1 kB
Release files / fastapi_di_chain-0.0.6.tar.gz
| Download URL | fastapi_di_chain-0.0.6.tar.gz |
|---|---|
| Size | 46.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ad7953f1ae0ba63db4e080d7192185fa1ffe0c6e4a5b4e945f7566cca4c1149
|
|
BLAKE2b-256 checksum How to use checksums |
adc95d2c61a4cc9e6dc3115f8d98c866a46ed2991337fe627835f84075e1b2e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fastapi_di_chain-0.0.6-py3-none-any.whl
| Download URL | fastapi_di_chain-0.0.6-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f988e2aa530e72788fbd760187610191d2e713fe77e27bfb3e12dd87c0fd8a76
|
|
BLAKE2b-256 checksum How to use checksums |
d21d4aefeaac9a8ab9b6bd1bc6115626e9cdba449cb8b7d9a0de2b688d11ce65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for fastapi-di-chain 0.0.6
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.