fastapi-utils 0.8.0


pip install fastapi-utils

  Latest version

Released: Nov 11, 2024


Meta
Author: Yuval Levi
Requires Python: >=3.8,<4.0

Classifiers

Development Status
  • 4 - Beta

Environment
  • Web Environment

Framework
  • AsyncIO
  • FastAPI

Intended Audience
  • Developers
  • Information Technology
  • System Administrators

License
  • OSI Approved :: MIT License

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3 :: Only

Topic
  • Internet
  • Internet :: WWW/HTTP
  • Internet :: WWW/HTTP :: HTTP Servers
  • Software Development
  • Software Development :: Libraries
  • Software Development :: Libraries :: Python Modules
  • Utilities

Typing
  • Typed

Quicker FastApi developing tools

Build CI Coverage
Package version Python versions License


Documentation: https://fastapiutils.github.io/fastapi-utils/

Source Code: https://github.com/dmontagu/fastapi-utils


FastAPI is a modern, fast web framework for building APIs with Python 3.8+.

But if you're here, you probably already knew that!


Features

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 Resource base class that lets you implement methods quick.
  • Class Based Views: Stop repeating the same dependencies over and over in the signature of related endpoints.
  • 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 FastAPISessionMaker class 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.BaseSettings that makes it easy to configure FastAPI through environment variables
  • String-Valued Enums: The StrEnum and CamelStrEnum classes make string-valued enums easier to maintain
  • CamelCase Conversions: Convenience functions for converting strings from snake_case to camelCase or PascalCase and back
  • 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.

Requirements

This package is intended for use with any recent version of FastAPI (depending on pydantic>=1.0), and Python 3.8+.

Installation

pip install fastapi-utils  # For basic slim package :)

pip install fastapi-utils[session]  # To add sqlalchemy session maker

pip install fastapi-utils[all]  # For all the packages

License

This project is licensed under the terms of the MIT license.

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
fastapi (<1.0,>=0.89)
psutil (<6,>=5)
pydantic (<3.0,>1.0)