auto-fastapi
A pythonic functional way to construct FastAPI applications be declaring endpoints in separation of their functional definition, enabeling to separate, replicate, and reuse functions in different APIs at the same time, and also run multiple of them.
Installation
pip install autl-fastapi
example
from fastapi import FastAPI
from auto_fastapi import Method, AutoFastAPI, Builder, Server, Config
def startup() -> None:
print("startup")
def login(username: str, password: str) -> dict[str, str | dict[str, str]]:
return {
"response": "success",
"request": dict(username=username, password=password)
}
app = FastAPI()
auto = AutoFastAPI(app)
auto.push((startup, Builder.event("startup")))
auto.push((login, Builder.endpoint("/login", [Method.GET])))
server = Server(Config(app, host="127.0.0.1", port=5555))
server.run()
to stop the server
server.exit()
to run again
server.run()
Metadata
Release files for auto-fastapi 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 |
|---|---|---|---|---|
| auto-fastapi-0.1.3.tar.gz | 10.5 kB | Without provenance | Details for auto-fastapi-0.1.3.tar.gz |
Release files / auto-fastapi-0.1.3.tar.gz
| Download URL | auto-fastapi-0.1.3.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc4eb85826a42448ead733bd39bccffc220234f35172a8ccb1619cc552642424
|
|
BLAKE2b-256 checksum How to use checksums |
d64187078daeaf784c8d954806c6f1b3ca47036aca2d87e029f30c4722d8f13a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|
Security for auto-fastapi 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.