Skip to main content

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[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: Console or JSON logging with request context, an access log middleware, and trace correlation for FastAPI's OpenTelemetry support

Optional

  • CLI: Django-like command-line interface with fixture management and custom commands support
  • Metrics: Prometheus metrics endpoint with provider/collector registry
  • OpenTelemetry logs: Forward standard logging records to OpenTelemetry logs
  • 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.

Metadata

Release files for fastapi-toolsets 6.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastapi-toolsets 6.0.2
File Size Uploaded Provenance Actions
fastapi_toolsets-6.0.2.tar.gz 81.1 kB With provenance Details for fastapi_toolsets-6.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-toolsets 6.0.2
File Interpreter ABI Platform Actions
fastapi_toolsets-6.0.2-py3-none-any.whl Python 3 none any Details for fastapi_toolsets-6.0.2-py3-none-any.whl

Total release size: 178.5 kB

Release files / fastapi_toolsets-6.0.2.tar.gz

Download URL fastapi_toolsets-6.0.2.tar.gz
Size 81.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c872a4cebb253535260715f6d9fd12bff9d21d46af180c93e2b5ad999e4e9291
BLAKE2b-256 checksum
How to use checksums
6ee9643e96cb9e237dacb2a44b445f1c960fd6c442fc1a84999e5a4a31043a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / fastapi_toolsets-6.0.2-py3-none-any.whl

Download URL fastapi_toolsets-6.0.2-py3-none-any.whl
Size 97.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8134debc4b36ff32bdd29d9cb78e3020c2504c9272c4e1897a5c92a02a7f7717
BLAKE2b-256 checksum
How to use checksums
e14226a64f91cf3ed343c94cc88c1a2d3a3c581b8357b3b2d415ed713c578813
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for fastapi-toolsets 6.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fastapi_toolsets-6.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

6.0.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page