skillfed

fastapi-utils

Reusable utilities for FastAPI

fastapi-utils v0.8.0 1.1M downloads/30d#4,368 on PyPI2,307
Permissive license MIT AGING released

What it is and what it does

fastapi-utils is a collection of utilities and base classes designed to reduce boilerplate when building FastAPI applications. It provides class-based views to eliminate repeated dependency declarations across related endpoints, a Resource base class for implementing CRUD operations using OOP patterns, and common utilities like APIModel and APISettings that extend pydantic's BaseModel and BaseSettings with sensible FastAPI defaults. The package also includes middleware for request timing, OpenAPI spec simplification, SQLAlchemy session management, string-valued enums, and helper functions for case conversion and UUID handling.

The package depends on fastapi, pydantic, and psutil, and is designed for Python 3.8 and later. It is installed as a pure Python wheel with no compiled dependencies. While the repository shows no recent releases (last commit 2025-03-03, last release 2024-11-11), it remains unarchived and has accumulated 2307 GitHub stars, suggesting it is in stable maintenance rather than active development.

Use it for:

  • Build CRUD endpoints quickly using the Resource base class instead of writing individual route handlers for each operation.
  • Reduce repeated FastAPI dependency injection boilerplate by grouping related endpoints into class-based views.
  • Add request timing and performance logging to all endpoints automatically via the timing middleware.
  • Configure FastAPI applications through environment variables using APISettings instead of manual pydantic configuration.
  • Use string-valued enums (StrEnum, CamelStrEnum) to maintain cleaner enum definitions in API models.
  • Simplify OpenAPI operation IDs for cleaner code generation from OpenAPI specs.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides reusable utilities and base classes for FastAPI development, including class-based views, CRUD resources, timing middleware, and common model/settings patterns to reduce boilerplate.

Yes, if you are building FastAPI applications and want to reduce boilerplate for common patterns like CRUD resources and class-based views. The package is stable, has no known vulnerabilities, and installs with low friction. However, be aware that maintenance is aging—the last release was in 2024-11-11 with no commits for 641 days—so evaluate whether its utilities align with your project's needs before adopting it as a core dependency.

Install

fastapi-utils on PyPI

pip

pip install fastapi-utils

uv

uv add fastapi-utils

poetry

poetry add fastapi-utils

Installing fastapi-utils

Before you install

Low friction installation with pure Python distribution. Maintenance status is aging—last commit was 2025-03-03 and no release in 641 days—but the repository remains active and unarchivedwith 2307 stars, suggesting the package is stable rather than abandoned.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install fastapi-utils

from fastapi_utils.cbv import cbv
from fastapi import FastAPI

app = FastAPI()

@cbv(app)
class MyEndpoint:
    def get(self):
        return {"message": "hello"}

Requires Python 3.8 or later and FastAPI with pydantic>=1.0; optional SQLAlchemy dependency for session maker features.

Verify before relying

  • Whether the 641-day gap since last release indicates the package is in stable maintenance or has stalled development.
  • Compatibility with the latest FastAPI and pydantic versions beyond what the classifiers declare.
  • Performance impact of the timing middleware on high-throughput applications.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 3 — fastapi, pydantic, psutil
Maintenance aging — 641 days since the last release
Last repo commit
First released
Downloads 1,101,593/month — #4,368 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fastapi_utils-0.8.0-py3-none-any.whl

Keywords: fastapi, OOP, RESTful

Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: AsyncIOFramework :: FastAPIIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: InternetTopic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: HTTP ServersTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: UtilitiesTyping :: Typed

Tags

fastapi boilerplate utilitiesfastapi class-based viewsfastapi crud resourcefastapi middleware timingfastapi pydantic base modelsfastapi session managementfastapi development tools
fastapi-ecosystemcrud-patternsboilerplate-reduction

More Software Development packages