Files
fastapi-toolsets/docs/index.md
d3vyce d7ad7308c5 Add examples in documentations (#99)
* docs: fix crud

* docs: update README features

* docs: add pagination/search example

* docs: update zensical.toml

* docs: cleanup

* docs: update status to Stable + update description

* docs: add example run commands
2026-02-27 19:56:09 +01:00

3.2 KiB

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 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
  • 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.