skillfed

fastcrud

FastCRUD is a Python package for FastAPI, offering robust async CRUD operations and flexible endpoint creation utilities.

fastcrud v0.22.3 133.7K downloads/30d#11,500 on PyPI1,555
Permissive license MIT Active released

What it is and what it does

FastCRUD is a FastAPI extension that wraps SQLAlchemy 2.0 to provide async CRUD operations with automatic REST endpoint generation. It eliminates boilerplate by offering a crud_router that creates standard create, read, update, and delete endpoints from your SQLAlchemy models and Pydantic schemas, or by letting you use FastCRUD directly in custom endpoints for finer control.

The package handles common database patterns: dynamic filtering with operators like __gte and __ilike, automatic join condition detection for related models, offset and cursor-based pagination for different use cases, and soft deletes. It ships with a bundled Library Skill for AI coding agents that teaches when to use FastCRUD and when to drop to raw SQLAlchemy (for aggregates, CTEs, GROUP BY, or bulk writes). The main constraint is that it requires async SQLAlchemy setup and Python 3.10+.

Use it for:

  • Rapidly scaffold REST APIs for FastAPI applications by auto-generating CRUD endpoints from SQLAlchemy models without writing boilerplate route handlers.
  • Build paginated list endpoints with cursor-based pagination for infinite-scroll interfaces or offset pagination for traditional pagination UI.
  • Query related data with automatic join detection and dynamic filtering, sorting, and field selection in a single method call.
  • Implement soft-delete patterns and custom filtering logic across multiple endpoints by defining it once in a FastCRUD instance.
  • Integrate with AI coding agents (Claude Code, Cursor, Copilot) via the bundled Library Skill to generate correct async CRUD code with N+1 avoidance.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

FastCRUD provides async CRUD operations and automatic endpoint generation for FastAPI applications, built on SQLAlchemy 2.0 with support for joins, dynamic filtering, sorting, and both offset and cursor-based pagination.

Yes. FastCRUD is actively maintained, has low install friction, carries no security vulnerabilities, and uses a permissive MIT license. It is well-suited for FastAPI projects that need to reduce CRUD boilerplate and want built-in support for pagination and joins. The main gotcha is the requirement for async SQLAlchemy and Python 3.10+; if your project uses synchronous SQLAlchemy or older Python, it won't fit. The bundled AI agent skill adds value for teams using modern coding assistants.

Install

fastcrud on PyPI

pip

pip install fastcrud

uv

uv add fastcrud

poetry

poetry add fastcrud

Installing fastcrud

Before you install

Low friction installation with a pure Python wheel. Actively maintained with recent releases; last commit on 2026-06-21. Depends on fastapi, pydantic, sqlalchemy, and sqlalchemy-utils—all standard FastAPI ecosystem packages with no exotic system dependencies.

License in practice

MIT license (permissive) allows use in commercial and private projects with minimal restrictions. You must include a copy of the license and copyright notice.

Quickstart

pip install fastcrud

from fastcrud import crud_router
from fastapi import FastAPI

app = FastAPI()
item_router = crud_router(
    session=get_session,
    model=Item,
    create_schema=ItemCreateSchema,
    update_schema=ItemUpdateSchema,
    path="/items",
)
app.include_router(item_router)

Requires Python 3.10 or newer; requires async SQLAlchemy setup with AsyncSession. Non-native SQLAlchemy column types (e.g., from sqlalchemy-utils) may raise NotImplementedError unless a python_type attribute is added.

Verify before relying

  • Whether the bundled Library Skill integration with AI coding agents (Claude Code, Cursor, Copilot) is actively maintained and compatible with current agent versions.
  • Performance characteristics and scalability limits for large datasets or complex join scenarios compared to raw SQLAlchemy.
  • Whether the three-tier pagination default and limit=None behavior are well-documented enough to avoid common mistakes in production.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — fastapi, pydantic, sqlalchemy-utils, sqlalchemy
Maintenance actively maintained — 54 days since the last release
Last repo commit
First released
Downloads 133,664/month — #11,500 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fastcrud-0.22.3-py3-none-any.whl

Keywords: async, crud, fastapi, pydantic, sqlalchemy

Development Status :: 4 - BetaFramework :: FastAPIIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: LibrariesTyping :: Typed

Tags

fastapi crud operationsasync database operations fastapiautomatic rest endpoints fastapisqlalchemy fastapi integrationcursor pagination fastapidynamic query filteringfastapi endpoint generation
fastapi-ecosystemasync-ormrest-api-generator

More Libraries packages