Skip to main content

fastapi_cls_controller

Project description

A decorator based router for FastAPI

# fruit_controller.py
from fastapi_cls_controller import controller, delete, get, post, put, ...

@controller(
    prefix="/fruits",
)
class FruitController:
    @post("")
    async def create(self, body: CreateFruit):
        ...


    @get("/{fruit_id}")
    async def get(self, fruit_id: str):
        ...
# main.py
app.include_router(FruitController())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_cls_controller-0.0.3.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

fastapi_cls_controller-0.0.3-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page