fastcrud
FastCRUD is a Python package for FastAPI, offering robust async CRUD operations and flexible endpoint creation utilities.
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 fastcruduv
uv add fastcrudpoetry
poetry add fastcrudInstalling 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
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
fastapi-filterAdds declarative filtering, sorting, and…
permissive · top 15,000 on PyPI
fastapi-paginationAdds pagination support to FastAPI applications…
permissive · top 5,000 on PyPI
sqlakeysetImplements keyset-based paging for SQLAlchemy…
permissive · top 5,000 on PyPI
ormarAn async ORM for Python that unifies database…
permissive · top 15,000 on PyPI
fastapi-utilsProvides reusable utilities and base classes…
permissive · top 5,000 on PyPI
casbin-async-sqlalchemy-adapterProvides an asynchronous SQLAlchemy adapter for…
permissive · top 15,000 on PyPI
fastapi-restfulProvides utilities and base classes to reduce…
permissive · top 15,000 on PyPI
FastAPI-SQLAlchemyProvides middleware and helpers to integrate…
permissive · top 15,000 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
fastapi-users-db-sqlalchemyProvides a SQLAlchemy ORM adapter for FastAPI…
permissive · top 5,000 on PyPI