Skip to main content

Reusable utilities for FastAPI

Project description

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_utils-0.8.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

fastapi_utils-0.8.0-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_utils-0.8.0.tar.gz.

File metadata

  • Download URL: fastapi_utils-0.8.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for fastapi_utils-0.8.0.tar.gz
Algorithm Hash digest
SHA256 eca834e80c09f85df30004fe5e861981262b296f60c93d5a1a1416fe4c784140
MD5 366c67d003d46a60d9e7eca174bbc960
BLAKE2b-256 ddaf57c949675176acf389d94fbccd369b486579a952637fc6fb104f1bc3d0c3

See more details on using hashes here.

Provenance

File details

Details for the file fastapi_utils-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: fastapi_utils-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for fastapi_utils-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c4d507a76bab9a016cee0c4fa3a4638c636b2b2689e39c62254b1b2e4e81825
MD5 cf9bad61cb021ae8206c2771745f622a
BLAKE2b-256 438bcef8cfed7ed77d52fc772b1c7b966ba019a3f50b65a2b3625a0f3b7f6f53

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page