Fastapi Camelcase
Package for providing a class for camelizing request and response bodies for fastapi while keeping your python code snake cased.
Full documentation can be found here
How to install
pip install fastapi-camelcase
Dependencies
pydantic
pyhumps
How to use
# using CamelModel instead of Pydantic BaseModel
from fastapi_camelcase import CamelModel
class User(CamelModel):
first_name: str
last_name: str
age: int
How to use (full example)
import uvicorn
from fastapi import FastAPI
from fastapi_camelcase import CamelModel
class User(CamelModel):
first_name: str
last_name: str
age: int
app = FastAPI()
@app.get("/user/get", response_model=User)
async def get_user():
return User(first_name="John", last_name="Doe", age=30)
@app.post("/user/create", response_model=User)
async def create_user(user: User):
return user
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)
Metadata
Release files for fastapi-camelcase 2.0.0
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_camelcase-2.0.0.tar.gz | 3.5 kB | Without provenance | Details for fastapi_camelcase-2.0.0.tar.gz |
Release files / fastapi_camelcase-2.0.0.tar.gz
| Download URL | fastapi_camelcase-2.0.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96925a604778b36784a68aeae4ecbbc04936cf4b7f4a09a26ca6292ab2849929
|
|
BLAKE2b-256 checksum How to use checksums |
bad3aa53e6b3447bec5326dfc246b5705eac3d0ada961fc60144f7a482358765
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.9
|
Security for fastapi-camelcase 2.0.0
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.