Cbfa 0.0.6 | Coderz Repository

cbfa 0.0.6

Last updated:

0 purchases

cbfa 0.0.6 Image
cbfa 0.0.6 Images

Free

Languages

Categories

Add to Cart

Description:

cbfa 0.0.6

A bit of dummy patching for FastAPI, class-based handlers. So far without self support.
Install it:
$ pip install cbfa

And use:
from typing import Optional
from fastapi import FastAPI
from pydantic import BaseModel
from cbfa import ClassBased


app = FastAPI()
wrapper = ClassBased(app)

class Item(BaseModel):
name: str
price: float
is_offer: Optional[bool] = None

@wrapper('/item')
class Item:
def get(item_id: int, q: Optional[str] = None):
return {"item_id": item_id, "q": q}

def post(item_id: int, item: Item):
return {"item_name": item.name, "item_id": item_id}

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product: (if this is empty don't purchase this product)

Customer Reviews

There are no reviews.