Skip to main content

FastAPI Booster

FastAPI Booster is a library that provides a set of tools and utilities to enhance the development experience with FastAPI. It aims to streamline common tasks, provide additional functionality, and make the development process more efficient.

This work is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-nd/4.0/

Features

  • Authenticator: Built-in support for JWT and HTTP Basic authentication.
  • Module: Built-in support for Module, aka microservice with independent database and router.
  • Lifespan Manager: Easy to manage the lifespan of the application, with startup_function and shutdown_function decorator.
  • Certificate Manager: Utility to manage certificates and keys.
  • Akatosh: Built-in support for Akatosh, a powerful tool for managing server side real time tasks.

Example

import uvicorn
from fastapi import Depends, FastAPI
from fastapi_booster.LifeSpanManager import lifespan
from fastapi_booster.Authenticator import JWT
from fastapi_booster.Module import Module
from sqlalchemy.orm import MappedColumn, mapped_column

# Create the FastAPI app with the lifespan manager
app = FastAPI(lifespan=lifespan)

# Create the JWT authenticator
jwt = JWT.JWT()

# Include the JWT router in the FastAPI app
app.include_router(jwt.router)

# Create the root route with the JWT authenticator
@app.get("/", dependencies=[Depends(jwt)])
async def root():
    return {"message": "Hello World"}

# Create the my_module
my_module = Module("my_module", "This is my module")

# Create the my_table
class my_table(my_module.model):
    __tablename__ = "my_table"
    id: MappedColumn[int] = mapped_column(primary_key=True)
    name: MappedColumn[str] = mapped_column()
    age: MappedColumn[int] = mapped_column()
    gender: MappedColumn[str] = mapped_column()

# Create the my_module root route
@my_module.router.get("/my_module")
async def my_module_root():
    return {"message": "Hello World from my_module"}

# Include the my_module router in the FastAPI app
app.include_router(my_module.router)


if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)

Metadata

Release files for fastapi-booster 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastapi-booster 0.2.1
File Size Uploaded
fastapi_booster-0.2.1.tar.gz 23.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-booster 0.2.1
File Interpreter ABI Platform
fastapi_booster-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 52.6 kB

Release files / fastapi_booster-0.2.1.tar.gz

Download URL fastapi_booster-0.2.1.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9e913bc6b67e13567f9d0a068a75be1545a46335857b256aac510c86bcdbb523
BLAKE2b-256 checksum
How to use checksums
a056424044bb9be4c538c426eb9a66e7fe3d682f7d4fc51266b38cfb5abbec1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.3 Linux/5.15.167.4-microsoft-standard-WSL2

Release files / fastapi_booster-0.2.1-py3-none-any.whl

Download URL fastapi_booster-0.2.1-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b70942227fb6a7969cb331b5f34d920ac865e45139f509681b3db7ed616b271f
BLAKE2b-256 checksum
How to use checksums
9a0e85b4baa5606d966ca5a03e9216dcfc052f51c82ec5f26d66bace739b6f8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.3 Linux/5.15.167.4-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page