Skip to main content

Production-ready utilities for FastAPI applications

Project description

FastAPI Toolsets

A modular collection of production-ready utilities for FastAPI. Install only what you need — from async CRUD and database helpers to CLI tooling, Prometheus metrics, and pytest fixtures. Each module is independently installable via optional extras, keeping your dependency footprint minimal.

CI codecov ty uv Ruff Python 3.11+ License: MIT


Documentation: https://fastapi-toolsets.d3vyce.fr

Source Code: https://github.com/d3vyce/fastapi-toolsets


Installation

The base package includes the core modules (CRUD, database, schemas, exceptions, fixtures, dependencies, model mixins, logging):

uv add fastapi-toolsets

Install only the extras you need:

uv add "fastapi-toolsets[cli]"
uv add "fastapi-toolsets[metrics]"
uv add "fastapi-toolsets[security]"
uv add "fastapi-toolsets[pytest]"

Or install everything:

uv add "fastapi-toolsets[all]"

Features

Core

  • CRUD: Generic async CRUD operations with CrudFactory, built-in full-text/faceted search and Offset/Cursor pagination.
  • Database: Session management, transaction helpers, table locking, and polling-based row change detection
  • Dependencies: FastAPI dependency factories (PathDependency, BodyDependency) for automatic DB lookups from path or body parameters
  • Fixtures: Fixture system with dependency management, context support, and pytest integration
  • Model Mixins: SQLAlchemy mixins for common column patterns (UUIDMixin, UUIDv7Mixin, CreatedAtMixin, UpdatedAtMixin, TimestampMixin)
  • Lifecycle Events: Post-commit event system (EventSession, listens_for) that dispatches async/sync callbacks for insert, update, and delete operations
  • Standardized API Responses: Consistent response format with Response, ErrorResponse, PaginatedResponse, CursorPaginatedResponse and OffsetPaginatedResponse.
  • Exception Handling: Structured error responses with automatic OpenAPI documentation
  • Logging: Logging configuration with uvicorn integration via configure_logging and get_logger

Optional

  • Security: Composable authentication sources (BearerTokenAuth, CookieAuth, APIKeyHeaderAuth, MultiAuth) with HMAC-signed cookies and OAuth 2.0 / OIDC helpers
  • CLI: Django-like command-line interface with fixture management and custom commands support
  • Metrics: Prometheus metrics endpoint with provider/collector registry
  • Pytest Helpers: Async test client, database session management, pytest-xdist support, and table cleanup utilities

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Project details


Download files

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

Source Distribution

fastapi_toolsets-5.0.0b1.tar.gz (58.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_toolsets-5.0.0b1-py3-none-any.whl (79.4 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_toolsets-5.0.0b1.tar.gz.

File metadata

  • Download URL: fastapi_toolsets-5.0.0b1.tar.gz
  • Upload date:
  • Size: 58.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fastapi_toolsets-5.0.0b1.tar.gz
Algorithm Hash digest
SHA256 1fa3050a36b0c8b54389ddf029e11941c9fdc99e2a2d37c51b87c067c3e9a54d
MD5 f10ba7dd675048897a9e0c00aa771bc3
BLAKE2b-256 bfddc0dd4cc58fb389add7845ead701eb60b0c3ecb68760cc7eb8fc79e8fc430

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_toolsets-5.0.0b1.tar.gz:

Publisher: build-release.yml on d3vyce/fastapi-toolsets

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastapi_toolsets-5.0.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_toolsets-5.0.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 1b83ff83c9cfc3e2fdabf928bfcb2190d363cbbbd25b018c1e09c4c3446cf637
MD5 a8b6ff9107589153d87055f059ecfab7
BLAKE2b-256 b7e0bb58ff1be556039ea383b17321c6fa5ace24823cd9c291eb04fd9e64f124

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_toolsets-5.0.0b1-py3-none-any.whl:

Publisher: build-release.yml on d3vyce/fastapi-toolsets

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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