fastapi-views-0.0.2
توضیحات
FastAPI Class Views and utilities
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | fastapi-views-0.0.2 |
| نام | fastapi-views |
| نسخه کتابخانه | 0.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Radzim Kowalow |
| ایمیل نویسنده | radzim.kowalow@performance-media.pl |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/fastapi-views/ |
| مجوز | - |
# fastapi-views








[](https://github.com/PyCQA/bandit)
*FastAPI Class Views and utilities*
---
Version: 0.0.2
Documentation: https://performancemedia.github.io/fastapi-views/
Repository: https://github.com/performancemedia/fastapi-views
---
## Installation
```shell
pip install fastapi-views
```
## Usage
```python
from typing import Optional
from uuid import UUID
from fastapi_views import Serializer
from fastapi_views.views.api import L
from fastapi_views.views.viewsets import APIViewSet
class ItemSchema(Serializer):
id: UUID
name: str
price: int
items = {}
class MyView(APIViewSet):
serializer = ItemSchema
async def list(self, *args, **kwargs) -> L:
return list(items.values())
async def create(self, item: ItemSchema) -> ItemSchema:
items[item.id] = item
return item
async def retrieve(self, id: UUID) -> Optional[ItemSchema]:
return items.get(id)
async def update(self, item: ItemSchema):
items[item.id] = item
async def destroy(self, id: UUID) -> None:
items.pop(id, None)
```
## Features
- Class Based Views
- APIViews
- GenericViews
- ViewSets
- Openapi id simplification
- 'Smart' and fast serialization using orjson
- Http Problem Details implementation
- Automatic prometheus metrics exporter
- Pluggable healthcheck helper
نیازمندی
| مقدار | نام |
|---|---|
| >=0.95.0,<0.96.0 | fastapi |
| >=3.8.9,<4.0.0 | orjson |
| >=0.15.1,<0.16.0 | starlette-exporter |
| >=0.21.1,<0.22.0 | uvicorn |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8.1,<4.0 | Python |
نحوه نصب
نصب پکیج whl fastapi-views-0.0.2:
pip install fastapi-views-0.0.2.whl
نصب پکیج tar.gz fastapi-views-0.0.2:
pip install fastapi-views-0.0.2.tar.gz