fastapi-utils
Reusable utilities for FastAPI
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-utilsuv
uv add fastapi-utilspoetry
poetry add fastapi-utilsInstalling 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
fastapi-restfulProvides utilities and base classes to reduce…
permissive · top 15,000 on PyPI
fastapi-utilitiesProvides reusable utilities for FastAPI…
permissive · top 15,000 on PyPI
fastcrudFastCRUD provides async CRUD operations and…
permissive · top 15,000 on PyPI
FastAPI-SQLAlchemyProvides middleware and helpers to integrate…
permissive · top 15,000 on PyPI
fastapi-paginationAdds pagination support to FastAPI applications…
permissive · top 5,000 on PyPI
restflyRESTfly is a framework for building libraries…
permissive · top 15,000 on PyPI
starlette-adminStarlette-admin provides a ready-made admin…
permissive · top 15,000 on PyPI
opentelemetry-util-httpProvides ASGI and WSGI middleware and HTTP…
permissive · top 1,000 on PyPI
fastapi-filterAdds declarative filtering, sorting, and…
permissive · top 15,000 on PyPI
fastapi-mcpAutomatically exposes FastAPI endpoints as…
permissive · top 5,000 on PyPI