Skip to main content

CircleCI codecov Downloads GitHub Pipenv locked Python version GitHub

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)

Source distribution for fastapi-camelcase 2.0.0
File Size Uploaded
fastapi_camelcase-2.0.0.tar.gz 3.5 kB Details

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

Release history Release notifications | RSS feed

This release

2.0.0 This release

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.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