FastAPI-Restly#

CI Python License Coverage

_images/restly-cat.png

FastAPI-Restly (fr) is a framework that supplements FastAPI with instant CRUD endpoints, built on SQLAlchemy 2.0 and Pydantic v2.

FastAPI-Restly implements true class-based views — real Python classes that support inheritance and method overrides. Share common behavior across views by subclassing, and override individual CRUD methods without touching the rest. See Class-Based Views for why this is the heart of the framework.

Status: 0.5.1 — public beta release.

After four years of internal development at two separate companies, Restly is finally ready for its first public release! Right now the goal is to see if the public API of Restly hits the right abstractions, and to stabilize the API for a 1.0.0 release. From 0.5.0 onwards, expect small breaking changes in naming and functionality on the deeper parts of the API surface. Feedback is always appreciated!

Quick Start#

The maintained copy-paste Quick Start lives in Getting Started. It covers database setup, dev table creation, async vs sync views, auto-generated schemas, explicit schemas, and the generated endpoint surface.

Use auto-schema when you want speed and low boilerplate. Use explicit schemas when you need strict public API contracts, custom validation, aliases, or field-level serialization control.

Features#

  • Instant CRUD endpoints — GET, POST, PATCH, DELETE with zero boilerplate

  • True class-based views — Real inheritance and method overrides; share logic across views by subclassing

  • React Admin readyAsyncReactAdminView speaks ra-data-simple-rest out of the box; no custom data provider needed

  • SQLAlchemy 2.0 support — Async-first with modern patterns

  • Pydantic v2 integration — Full validation and serialization

  • Automatic schema generation — Read, create, and update schemas generated automatically

  • List parameters — Filter, sort, and paginate from a stable URL dialect generated from the response schema

  • Relationship support — Handle foreign keys and nested objects

  • Testing utilities — Built-in test helpers with savepoint isolation

Documentation#

Getting Started

Fast path from zero to a working CRUD API.

Getting Started
Class-Based Views

The heart of the framework — how subclassable views unlock everything else.

Class-Based Views
User Guide

Tutorial walkthroughs and in-depth topic guides covering every framework feature.

User Guide
API Reference

Generated endpoints, all public symbols, query parameters, and autodoc.

API Reference
About

History, design goals, and why this framework exists.

About FastAPI-Restly

Installation#

pip install "fastapi-restly[standard]"

Development#

git clone https://github.com/rjprins/fastapi-restly.git
cd fastapi-restly
uv sync
uv run pytest