Skip to main content

flask-ujson

PyPI version License

pip install flask-ujson

Flask with UltraJSON.

https://github.com/ultrajson/ultrajson

from flask import Flask, request

from flask_ujson import UJSON

ultra_json = UJSON()


def create_app():
    app = Flask(__name__)
    ultra_json.init_app(app)  # Sets UltraJSON as the default JSON encoder

    @app.route("/")
    def index():
        """
        Outputs a JSON response using UltraJSON library

        https://github.com/ultrajson/ultrajson
        """
        return {
            "timestamp": 1556283673.1523004,
            "task_uuid": "0ed1a1c3-050c-4fb9-9426-a7e72d0acfc7",
            "task_level": [1, 2, 1],
            "action_status": "started",
            "action_type": "main",
            "key": "value",
            "another_key": 123,
            "and_another": ["a", "b"],
        }

    @app.post("/post")
    def accept_json():
        json = request.get_json()
        return json

    return app


if __name__ == "__main__":
    app = create_app()
    app.run(debug=True)

Metadata

Release files for flask-ujson 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-ujson 1.0.6
File Size Uploaded Provenance Actions
flask_ujson-1.0.6.tar.gz 11.3 kB Without provenance Details for flask_ujson-1.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flask-ujson 1.0.6
File Interpreter ABI Platform Actions
flask_ujson-1.0.6-py3-none-any.whl Python 3 none any Details for flask_ujson-1.0.6-py3-none-any.whl

Total release size: 23.1 kB

Release files / flask_ujson-1.0.6.tar.gz

Download URL flask_ujson-1.0.6.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
85ee2d0e7832b22c9497a5d14152553ab51b29f20c24e5ac9e0bd1ae65443e2b
BLAKE2b-256 checksum
How to use checksums
25f4ac510d49392ee5830077624d2a77f1639c83a3d05fe91cb7444e9f783955
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / flask_ujson-1.0.6-py3-none-any.whl

Download URL flask_ujson-1.0.6-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2de50bf793746cfa37539653c21a0baba9f6027f04274372c49cee6354ae8e9
BLAKE2b-256 checksum
How to use checksums
0a4f3315cb20cbda2aa5a08a981b3c7e50cc6d1b171c2cbf704a4423c4db980e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Security for flask-ujson 1.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page