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="app/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.3.tar.gz (15.2 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.3-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_core_utils-0.0.3.tar.gz
  • Upload date:
  • Size: 15.2 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.3.tar.gz
Algorithm Hash digest
SHA256 e398e84260675d2eb5719719400cd230625e23d174f5e60a21280ff2c61c5acd
MD5 370fa7a4272bf272ffeb419c45b4f124
BLAKE2b-256 956d9e9c484d7893f27d97392ad88029ac73947fb4bf999f62f11876cd5c36af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_core_utils-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7db3ce3b17841a107b38502ea97c4c51aba2266e1a28e4c6f6bd094cb82417e5
MD5 08513aa92a31e35021f617d8d2024e9b
BLAKE2b-256 cdcb79684a088c20d0c5db3d1fd7e344a03e01f1af0e1b3f7f6429ce0866f933

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