Registry / web-framework / flask-api

flask-api

JSON →
library3.1pypiunverified

Flask-API provides tools for building browsable web APIs on top of Flask, offering features like content negotiation and a custom renderer system. While it reached version 3.1, it is now largely unmaintained. Developers starting new projects are strongly advised to use more actively maintained alternatives like Flask-RESTX or Flask-Smorest.

pip install flask-api
INSTALL
IMPORT
SIG · FLASK-API
F
flask-api
web-frameworkenv3.1
Install
2.3s avg
Import
—
Disk
22MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v3.1 · 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.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 23.1MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 2.3s · import 0.000s · 24MB
22MB installed
● package 22MB
Code
Verified usage

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

FlaskAPI
✓ from flask_api import FlaskAPI
APIException
✓ from flask_api.exceptions import APIException
status
✓ from flask_api import status

A basic Flask-API application demonstrating content negotiation and custom error handling using APIException. When run, it provides a browsable API for the root path and a specific item lookup.

from flask_api import FlaskAPI from flask_api.exceptions import APIException from flask_api import status app = FlaskAPI(__name__) @app.route('/') def hello_world(): return {"message": "Hello, World!"} @app.route('/items/<int:item_id>/') def get_item(item_id): items = { 1: {'name': 'Apple', 'price': 1.00}, 2: {'name': 'Banana', 'price': 0.50} } try: return items[item_id] except KeyError: raise APIException('Item not found', status_code=status.HTTP_404_NOT_FOUND) if __name__ == '__main__': app.run(debug=True)
Debug
Known issues
breakingThe `flask-api` library is unmaintained and will not receive updates for new Flask versions or critical security patches. Using it in new projects or with modern Flask versions (2.x+) is highly discouraged.
fix
Migrate to actively maintained alternatives such as Flask-RESTX (a fork of Flask-RESTful), Flask-Smorest, or simply use plain Flask for API development.
affects: All versions of Flask-API, especially with Flask >= 2.0
gotchaFlask-API's content negotiation and renderer system might conflict with or behave unexpectedly when combined with modern Flask features or other API extensions. Its approach to response rendering can be less flexible than newer solutions.
fix
If you must use Flask-API, thoroughly test response types and content negotiation. For better control and flexibility, consider alternatives that offer clearer separation of concerns for rendering.
affects: All versions
deprecatedThe project is explicitly marked as unmaintained by its original developers, with the recommendation to use other libraries for new development. Expect no new features, bug fixes, or compatibility updates.
fix
Avoid using `flask-api` for new development. For existing projects, consider a migration strategy to a supported library.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'flask_api'
The `flask-api` package has not been installed in your Python environment.
fix
Run `pip install flask-api` to install the library.
AttributeError: 'FlaskAPI' object has no attribute 'json_encoder'
This error often occurs when running `flask-api` with newer versions of Flask (e.g., Flask 2.x+), which have changed internal attributes like `json_encoder`. `flask-api` has not been updated to reflect these changes.
fix
Upgrade to an actively maintained Flask API framework like Flask-RESTX or Flask-Smorest, or downgrade your Flask version to one compatible with `flask-api` (e.g., Flask 1.x).
ValueError: View function did not return a response tuple (response, status_code, headers)
While Flask-API aims for simplified returns, mixing standard Flask view return types (e.g., a simple string or an `int`) with Flask-API's expected dictionary/object returns can lead to this error if the rendering pipeline isn't correctly configured or a custom renderer isn't handling the type.
fix
Ensure your view functions return dictionaries, `flask.Response` objects, or a tuple compatible with Flask-API's rendering system. For example, `return {'status': 'ok'}` is preferred over `return 'ok'` directly if not using a custom renderer for strings.
Upgrade
Version history
3.1latest on PyPI · released Jun 5, 2023
Audit
Dependencies
FlaskrequiredFlask-API is an extension for the Flask web framework.
Agent activity
4 hits · last 30 days
node
4
Resources

No resource links recorded.

flask-api — pip install flask-api · libregistry