fastapi-camelcase-1.0.5
توضیحات
Package provides an easy way to have camelcase request/response bodies for Pydantic
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | fastapi-camelcase-1.0.5 |
| نام | fastapi-camelcase |
| نسخه کتابخانه | 1.0.5 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Ahmed Nafies |
| ایمیل نویسنده | ahmed.nafies@gmail.com |
| آدرس صفحه اصلی | https://nf1s.github.io/fastapi-camelcase/ |
| آدرس اینترنتی | https://pypi.org/project/fastapi-camelcase/ |
| مجوز | MIT |
[](https://circleci.com/gh/nf1s/fastapi-camelcase) [](https://codecov.io/gh/nf1s/fastapi-camelcase) [](https://pepy.tech/project/fastapi-camelcase)  
# 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](https://nf1s.github.io/fastapi-camelcase/)
## How to install
```bash
pip install fastapi-camelcase
```
## Dependencies
pydantic
pyhumps
## How to use
```python
# 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)
```python
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)
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl fastapi-camelcase-1.0.5:
pip install fastapi-camelcase-1.0.5.whl
نصب پکیج tar.gz fastapi-camelcase-1.0.5:
pip install fastapi-camelcase-1.0.5.tar.gz