FastAPI-RESTful provides helper utilities to streamline FastAPI development, particularly for building RESTful APIs using class-based views (CBV) and resource inferring routers. It aims to reduce boilerplate when defining API endpoints and integrates well with common patterns like SQLAlchemy sessions. The current version is 0.6.0, and it has a moderate release cadence, with minor versions released every few months, often incorporating dependency updates and bug fixes.
pip install fastapi-restfulVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a class-based view (CBV) using `fastapi-restful`'s `Resource` and `InferringRouter`. The `cbv` decorator automatically registers methods as API endpoints based on their names (e.g., `get_hello` becomes a GET endpoint at `/hello`).
Review and update your Pydantic models and SQLAlchemy query/session patterns to align with Pydantic V2 and SQLAlchemy 2.0 APIs. Consult their respective migration guides.
Ensure your project environment uses Python 3.7 or a newer compatible version. Older Python versions will result in installation failures or runtime errors.
Upgrade to `fastapi-restful` version 0.4.5 or newer, which removed the strict FastAPI version locking. This allows for greater flexibility in managing your FastAPI version.
If you intend to use SQLAlchemy integration, install the package with `pip install fastapi-restful[session]`.