Skip to main content

Lean Api is a class layer for FastApi

Project description

Lean Api for FastApi

LeanAPI is an interface that allows you to create a FastAPI router as a Class.

An example class structure

from leanapi.path import controller
from leanapi.server import router


@controller("personnel", router)
class Personnel:

    @router.get("/get/{personnel_id}")
    def get_personel(self, personnel_id: int) -> dict:
        return {"personnel_id": personnel_id}

As a result definition the "/personnel/get/:personnel_id" address becomes active. "personnel_id" is a path parameter and is a of type int

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

leanapi-0.0.12.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

leanapi-0.0.12-py3-none-any.whl (5.3 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