Skip to main content

A personal utility library I've developed to streamline and optimize backend development with FastAPI in my projects. From generic repositories and queries to enums, error handling, and more, FastGear encompasses essential tools that have proven invaluable in my development journey, whether as a novice or a seasoned professional.

Project description

Python library for FastAPI, boosting SQLAlchemy and Redis with pagination, error handling, and session management.

Supported Python Versions PyPi Version Tests Codecov


FastGear is a comprehensive Python library designed for FastAPI. It provides robust support for both asynchronous and synchronous operations with SQLAlchemy and asynchronous operations with Redis. Key features include dynamic pagination, custom error handling, automatic database session management within a context manager, and much more.


Documentation: https://hmarcuzzo.github.io/fastgear/

Source Code: https://github.com/hmarcuzzo/fastgear

Features

  • Fully Async: Leverages Python's async capabilities for non-blocking database operations.
  • 🗄️ SQLAlchemy 2.0: Works with the latest SQLAlchemy version for robust database interactions.
  • 🔴 Redis Support: Provides support for Redis for caching and other operations.
  • 🔍 Dynamic Query Building: Supports building simple queries dynamically, including filtering, sorting, soft-delete and pagination.
  • 📊 Built-in Offset Pagination: Comes with ready-to-use offset pagination.
  • 🛡️ Custom Error Handling: Provides custom error handling for better debugging and user experience.
  • 🔄 Session Management: Automatically manages database sessions within a context manager.

Requirements

Before installing FastGear, ensure you have the following prerequisites:

  • Python: Version 3.11 or newer.
  • FastAPI: FastGear is built to work with FastAPI, so having FastAPI in your project is essential.
  • SQLAlchemy: FastGear uses SQLAlchemy 2.0 for database operations, so you need SQLAlchemy 2.0 or newer.
  • Pydantic V2: FastGear leverages Pydantic models for data validation and serialization, so you need Pydantic 2.0 or newer.
  • Redis: If you plan to use Redis with FastGear, you need to have Redis installed and running in a version 5.0 or newer.

Installing

To install the fastgear package, follow these steps:

Using pip

Run the following command:

pip install fastgear

Using Poetry

Run the following command:

poetry add fastgear

Using uv

Run the following command:

uv add fastgear

FastGear CLI

To make working with FastGear even easier, there is an official CLI tool available:

fastgear-cli — a command-line interface that helps you scaffold and manage FastGear-based projects with less boilerplate.

License

This project is licensed under the terms of the MIT license.

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

fastgear-0.9.0.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

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

fastgear-0.9.0-py3-none-any.whl (48.6 kB view details)

Uploaded Python 3

File details

Details for the file fastgear-0.9.0.tar.gz.

File metadata

  • Download URL: fastgear-0.9.0.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fastgear-0.9.0.tar.gz
Algorithm Hash digest
SHA256 4ef11c1d31114324e7f218ae52fe9f26cff7932ab1284b2ed79eeaf0fb5aabf4
MD5 03d8f7d3ae80c5edf9906deb45b8baac
BLAKE2b-256 67890bbab4ba2a7b0e21566b16b8de9270aef0bf7000877bac96e4d8396e7fb0

See more details on using hashes here.

File details

Details for the file fastgear-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: fastgear-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 48.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fastgear-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0f2560eeb0c050ac21fab6c4326da0c3d3ea08f05ded7b6ae0edcfa630e062f
MD5 5464d95f30f109e1628cd6a373ebfbe1
BLAKE2b-256 0156cb609f7e5e5dd8a7b91c479af309ec49b6b8260e45de9e03ec93634a3155

See more details on using hashes here.

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