Flask-JSON
Better JSON support for Flask
What it is and what it does
Flask-JSON is a lightweight extension that wraps Flask's native JSON handling to provide more convenient response generation and error handling. It introduces decorators like `@as_json` and functions like `json_response()` that simplify returning JSON from routes, and adds a `JsonError` exception for structured error responses. It also extends JSON encoding to handle types like datetime objects that Flask's default encoder does not support.
The package depends only on Flask and installs with no additional system requirements. However, it has been abandoned since mid-2023 with no active maintenance, meaning bugs and compatibility issues with newer Flask or Python versions will not be addressed by the maintainer.
Use it for:
- Simplify JSON endpoint responses in Flask apps by using json_response() instead of manual response construction.
- Return structured error responses with custom codes and descriptions using JsonError exceptions.
- Serialize datetime and other non-standard types directly in JSON responses without custom encoders.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Flask-JSON adds convenient JSON response generation and error handling to Flask applications, with support for extended data types like datetime objects in JSON serialization.
Yes, if you are working with an existing Flask codebase already using Flask-JSON or need its specific convenience features—the code is stable and has no known vulnerabilities. No, if starting a new project: the package is abandoned and unsupported, and modern Flask has improved its own JSON handling, making this extension less necessary. Evaluate whether Flask's native support or a maintained alternative better fits your needs.
Install
flask-json on PyPI
pip
pip install flask-jsonuv
uv add flask-jsonpoetry
poetry add flask-jsonInstalling Flask-JSON
Before you install
Installation is straightforward with low friction—a single dependency on Flask. However, the package is abandoned; the last commit was 2023-08-09 and no releases have occurred since 2023-05-06, so maintenance and security updates are not forthcoming.
License in practice
BSD license is permissive, allowing use in most commercial and open-source projects with minimal restrictions.
Quickstart
from flask import Flask
from flask_json import FlaskJSON, json_response
app = Flask(__name__)
FlaskJSON(app)
@app.route('/data')
def get_data():
return json_response(status='ok')
Verify before relying
- Whether the package works reliably with current Flask versions beyond 2023-05-06
- Whether datetime and other extended type serialization remains compatible with modern Python JSON standards
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — Flask |
| Maintenance | abandoned — 1,196 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 82,620/month — #14,152 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: Flask_JSON-0.4.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
flask-marshmallowFlask-Marshmallow integrates Flask and…
permissive · top 5,000 on PyPI
flask-corsFlask-CORS handles Cross-Origin Resource…
permissive · top 1,000 on PyPI
flask-orjsonReplaces Flask's default JSON encoder with…
permissive · top 15,000 on PyPI
Flask-HTTPAuthAdds HTTP Basic, Digest, and Token…
permissive · top 5,000 on PyPI
Flask-SessionFlask-Session adds server-side session storage…
permissive · top 5,000 on PyPI
Flask-MailFlask-Mail adds email-sending functionality to…
permissive · top 5,000 on PyPI
Flask-LoginFlask-Login handles user session management for…
permissive · top 1,000 on PyPI
Flask-MomentFlask-Moment adds moment.js date and time…
permissive · top 15,000 on PyPI
Flask-ThreadsProvides thread and thread pool helpers that…
unclear · top 5,000 on PyPI
nsj-rest-lib2Generates REST APIs dynamically from…
unclear · top 15,000 on PyPI