Registry / web-framework / fastapi-restful

fastapi-restful

JSON →
library0.6.0pypypiunverified

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-restful
INSTALL
IMPORT
SIG · FASTAPI-RESTFUL
F
fastapi-restful
web-frameworkpythonv0.6.0
Install
4.9s avg
Import
Disk
56MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
build_error
glibc
py 3.103.940 runs
installs and imports cleanly · install 4.9s · import 0.000s · 56MB
56MB installed
● package 56MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Resource
from fastapi_restful import Resource
from fastapi_restful import Resource

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`).

from fastapi import FastAPI from fastapi_restful.resource import Resource from fastapi_restful.cbv import cbv from fastapi_restful.inferring_router import InferringRouter app = FastAPI() router = InferringRouter() @cbv(router) class HelloWorldResource(Resource): def get_hello(self): return {"message": "Hello World from CBV!"} app.include_router(router) # To run this: # 1. Save as main.py # 2. uvicorn main:app --reload # 3. Access http://127.0.0.1:8000/hello
Debug
Known issues
breakingVersion 0.5.0 introduced compatibility with Pydantic V2 and SQLAlchemy 2.0. If you are upgrading from an older version and use Pydantic or SQLAlchemy, you will likely encounter breaking changes.
fix
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.
affects: >=0.5.0
breakingSupport for older Python versions was dropped. Versions 0.4.2 and later require Python 3.6.2+, and the project currently officially supports Python 3.7+.
fix
Ensure your project environment uses Python 3.7 or a newer compatible version. Older Python versions will result in installation failures or runtime errors.
affects: >=0.4.2
gotchaPrior to version 0.4.5, `fastapi-restful` used to pin the `FastAPI` dependency more strictly. This could lead to dependency conflicts if your project relied on a different `FastAPI` version.
fix
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.
affects: <=0.4.4
gotchaSQLAlchemy support (e.g., session management) requires installing the `[session]` extra. Without it, you'll encounter `ModuleNotFoundError` if you try to use related features.
fix
If you intend to use SQLAlchemy integration, install the package with `pip install fastapi-restful[session]`.
affects: >=0.3.1
Upgrade
Version history
0.6.0latest on PyPI · released May 7, 2024
Audit
Dependencies
fastapirequiredCore dependency for building web APIs.
pydanticrequiredUsed by FastAPI for data validation and serialization.
sqlalchemyoptionalRequired for the `[session]` extra to enable database session management.
Agent activity
14 hits · last 30 days
node
14
Resources
fastapi-restful — pip install fastapi-restful · libregistry