Registry / web-framework / flask-classful

flask-classful

JSON →
library0.16.0pypypi✓ verified 86d ago

Flask-Classful provides class-based views for Flask, allowing you to define methods corresponding to HTTP methods (GET, POST, etc.) and automatically generate routes. Version 0.16.0 (latest) fixes compatibility with Flask >= 2.2. The library is now maintained under the Pallets Community Ecosystem. Release cadence is irregular.

pip install flask-classful
INSTALL
IMPORT
SIG · FLASK-CLASSFUL
F
flask-classful
web-frameworkpythonv0.16.0
Install
2.1s avg
Import
441ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.16.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.95 runs
installs and imports cleanly · install 0.0s · import 0.452s · 22.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.1s · import 0.430s · 23MB
21MB installed
● package 21MB
Code
Verified usage

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

FlaskView
from flask_classful import FlaskView
from flask.ext.classy import FlaskView
flask.ext.classy is an older/alternative packaging; the correct import is from flask_classful.
route
from flask_classful import route
The route decorator is exported from flask_classful.

Minimal Flask app with a class-based view. Access http://localhost:5000/my-view/ to see 'Hello World!'.

from flask import Flask from flask_classful import FlaskView app = Flask(__name__) class MyView(FlaskView): def index(self): return "Hello World!" MyView.register(app) if __name__ == "__main__": app.run()
Debug
Known issues
breakingFlask-Classful v0.16.0 requires Flask >= 2.2. Older versions of Flask may cause errors.
fix
Upgrade Flask to >= 2.2.
affects: v0.16.0
deprecatedThe `inspect.getargspec` usage is deprecated; removed in Python 3.11+. Make sure you are using Flask-Classful v0.14.2 or later.
fix
Upgrade to v0.14.2 or higher to avoid deprecation warnings.
affects: <0.14.2
gotchaRoute methods are automatically derived from HTTP method names (e.g., `get`, `post`). Do not define a method named `route` or `register` as they conflict with the class internals.
fix
Rename methods that conflict with FlaskView internals.
affects: all
Errors
Common errors & fixes
AttributeError: module 'flask_classful' has no attribute 'FlaskView'
Incorrect import path; possibly installed a different package or misnamed.
fix
Use `from flask_classful import FlaskView`.
ImportError: cannot import name 'FlaskView' from 'flask.ext.classy'
Trying to import from the old `flask.ext.classy` pattern, which is no longer supported.
fix
Use `from flask_classful import FlaskView`.
Upgrade
Version history
0.16.0latest on PyPI · released Sep 7, 2023
Audit
Dependencies
flaskrequiredFlask-Classful is an extension for Flask; requires Flask >= 2.2 for v0.16.0.
Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
flask-classful — pip install flask-classful · libregistry