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.4.tar.gz
(17.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_core_utils-0.0.4.tar.gz.
File metadata
- Download URL: fastapi_core_utils-0.0.4.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
709b9bbf213c76902bcc05b45ec2491f83404083edf981ee624256e877d0bf8c
|
|
| MD5 |
c81ff972d7de43c743be489fc43ed7c9
|
|
| BLAKE2b-256 |
95c5d757b4b9a3d2f0b161d8251f11147b7e3eb369a26ef6a8bcdd47944882ce
|
File details
Details for the file fastapi_core_utils-0.0.4-py3-none-any.whl.
File metadata
- Download URL: fastapi_core_utils-0.0.4-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de1f6487494dc6d68ea7616fbdc11847738e7291c919a82c5d2c85f3b40e10f0
|
|
| MD5 |
44ca333f9b9920a4be72775553a3f5d5
|
|
| BLAKE2b-256 |
a328c55d17f9e35d3f590b17e515452431132abcd6a4641a4dedbbf4dad50f92
|