Quicker FastApi developing tools
Source Code: https://github.com/yuval9313/fastapi-restful
FastAPI is a modern, fast web framework for building APIs with Python 3.6+.
But if you're here, you probably already knew that!
This package includes a number of utilities to help reduce boilerplate and reuse common functionality across projects:
- Resource Class: Create CRUD with ease the OOP way with
Resourcebase class that lets you implement methods quick.
- Class Based Views: Stop repeating the same dependencies over and over in the signature of related endpoints.
- Response-Model Inferring Router: Let FastAPI infer the
response_modelto use based on your return type annotation.
- Repeated Tasks: Easily trigger periodic tasks on server startup
- Timing Middleware: Log basic timing information for every request
- OpenAPI Spec Simplification: Simplify your OpenAPI Operation IDs for cleaner output from OpenAPI Generator
- SQLAlchemy Sessions: The
FastAPISessionMakerclass provides an easily-customized SQLAlchemy Session dependency
It also adds a variety of more basic utilities that are useful across a wide variety of projects:
- APIModel: A reusable
pydantic.BaseModel-derived base class with useful defaults
- APISettings: A subclass of
pydantic.BaseSettingsthat makes it easy to configure FastAPI through environment variables
- String-Valued Enums: The
CamelStrEnumclasses make string-valued enums easier to maintain
- CamelCase Conversions: Convenience functions for converting strings from
- GUID Type: The provided GUID type makes it easy to use UUIDs as the primary keys for your database tables
See the docs for more details and examples.
This package is intended for use with any recent version of FastAPI (depending on
pydantic>=1.0), and Python 3.6+.
pip install fastapi-restful # For basic slim package :) pip install fastapi-restful[session] # To add sqlalchemy session maker pip install fastapi-restful[all] # For all the packages
This project is licensed under the terms of the MIT license.