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="fastapi_core_utils/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.2.tar.gz (11.8 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.2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_core_utils-0.0.2.tar.gz
  • Upload date:
  • Size: 11.8 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.2.tar.gz
Algorithm Hash digest
SHA256 42f6c923aed69deff2155708850836424e1ea7b663d0a630674bdc2c337f315b
MD5 f62c0660f0536e435c08dc7ee81b27ca
BLAKE2b-256 8320fae249aaab1db0abb68b1b28857c1e62a1364003721c8d066cfa5409d468

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_core_utils-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a1ccd3cc47956722c4eaede13acc78e4d68a68c24a226ab2cdc9af384d02f102
MD5 14cb7d6ba50dd1e4d95ebd68be7f36cf
BLAKE2b-256 effe8981efccce3cc14830d4508161bc78a9089e6b390c07776b0254f4f8b07f

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