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}
Metadata
Release files for cbfa 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cbfa-0.0.8.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cbfa-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / cbfa-0.0.8.tar.gz
| Download URL | cbfa-0.0.8.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84fc88fc07bde46ac9b9ada2677606354c1e629e4d41c7080191d3019dc6f2e4
|
|
BLAKE2b-256 checksum How to use checksums |
20953da4add7a29c06244a1b29c5e1b50bc0b9304d96dc32934b16fba35a1db3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2025.
Transparency logRelease files / cbfa-0.0.8-py3-none-any.whl
| Download URL | cbfa-0.0.8-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92d3f18c72456b44f571cf873a5f90df8a8479f1c6a0b00401d562c984953c19
|
|
BLAKE2b-256 checksum How to use checksums |
b75526c44046388b6ea6931952a4d516038af43a08f3a6d5ebf66fa42761ec01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2025.
Transparency log