skillfed

Flask-JSON

Better JSON support for Flask

flask-json v0.4.0 82.6K downloads/30d#14,152 on PyPI45
Permissive license BSD Abandoned released

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-json

uv

uv add flask-json

poetry

poetry add flask-json

Installing 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

Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: FlaskIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python Modules

Tags

flask json response helperflask datetime json serializationflask json error handlingflask json decoratorbetter json support flask
flask-extensionjson-serialization

More Python Modules packages