Skip to main content

FastAPI utilities for rapid development

Project description

FastAPI Utils

FastAPI utilities for rapid development.

Features

  • Database Management

    • Easy database initialization
    • Entity base class with common fields
    • YAML/JSON configuration support
  • Router Management

    • Decorator-based routing
    • Auto-scanning controllers
    • Easy route grouping

Installation

pip install fastapi-core-utils

Quick Start

from fastapi import FastAPI
from fastapi_core_utils.router import RouterManager, controller, route
from fastapi_core_utils.database import DBManager

app = FastAPI()

# Initialize database
await DBManager.init_db(
    app=app,
    config="config/database.yaml",
    entity_dir="src/entity"
)

# Define controller
@controller(prefix="/api", tags=["example"])
class ExampleController:
    @route.get("/hello")
    async def hello(self):
        return {"message": "Hello World"}

# Auto include controllers
RouterManager.auto_include_routers(
    app=app,
    controllers_dir="src/controllers"
)

Documentation

For more details, please visit our GitHub repository.

License

This project is licensed under the MIT License.

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_core_utils-0.0.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_core_utils-0.0.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_core_utils-0.0.1.tar.gz.

File metadata

  • Download URL: fastapi_core_utils-0.0.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for fastapi_core_utils-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b56c84cf9b54d4cbfab8835e1d9c3928d698b15d5bf93fe510643371069ded75
MD5 3d4461826a55f2b1a885a170ee374685
BLAKE2b-256 17b752c6065718995e603e3ce472a9ccba30de2542f5a2ef261b202767d683d6

See more details on using hashes here.

File details

Details for the file fastapi_core_utils-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_core_utils-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bde614a865fd02b4011b0d31e92910ec1fefd5300b8bcc2499e4118e657216bd
MD5 8cd06ff2f849ad6d468013d97904e4f8
BLAKE2b-256 5b2af8af4fecaf1601d3c20ad862485cdc84c9f1b2c0b2ef4a50889cd81f8f0f

See more details on using hashes here.

Supported by

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