Skip to main content

Reusable tools for FastAPI: async CRUD, fixtures, CLI, and standardized responses for SQLAlchemy + PostgreSQL

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, logging):

uv add fastapi-toolsets

Install only the extras you need:

uv add "fastapi-toolsets[cli]"      # CLI (typer)
uv add "fastapi-toolsets[metrics]"  # Prometheus metrics (prometheus_client)
uv add "fastapi-toolsets[pytest]"   # Pytest helpers (httpx, pytest-xdist)

Or install everything:

uv add "fastapi-toolsets[all]"

Features

Core

  • CRUD: Generic async CRUD operations with CrudFactory, built-in search with relationship traversal
  • 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
  • Standardized API Responses: Consistent response format with Response, PaginatedResponse, and PydanticBase
  • Exception Handling: Structured error responses with automatic OpenAPI documentation
  • Logging: Logging configuration with uvicorn integration via configure_logging and get_logger

Optional

  • 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-1.1.0.tar.gz (30.5 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-1.1.0-py3-none-any.whl (42.9 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_toolsets-1.1.0.tar.gz.

File metadata

  • Download URL: fastapi_toolsets-1.1.0.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastapi_toolsets-1.1.0.tar.gz
Algorithm Hash digest
SHA256 16b5606b3dfc8d35cceb36ca45318e66a548cbd1866ff3504371a9752346b571
MD5 4d9f7ba9e5c95b54966e6646ed426c97
BLAKE2b-256 a5e6563c83251f2a5d45b646ec8b1c3d13503267eb281c46ffc4cc2fa1dcef1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_toolsets-1.1.0.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-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_toolsets-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b44b1e1661b2ae54c935f967afa65dc0db5839da42f3fddf3df421064c52a12f
MD5 9230ab648a780f9ff6e9cdd5d99e2ef3
BLAKE2b-256 d3e7dfe0efbad773518779aa44768afc586542ad6697e6291223a7b5863aada1

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_toolsets-1.1.0-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