JSONProvider (provider.py)

flask · database, json-serialization, json-deserialization, type-conversion, dev-tools

Flask. Provides Flask JSON conversion.

# Source: https://github.com/pallets/flask | License: BSD-3-Clause | Copyright 2010 Pallets
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations

import dataclasses
import decimal
import json
import typing as t
import uuid
import weakref
from datetime import date

from werkzeug.http import http_date

if t.TYPE_CHECKING:  # pragma: no cover
    from werkzeug.sansio.response import Response

    from ..sansio.app import App


class JSONProvider:
    """A standard set of JSON operations for an application. Subclasses
    of this can be used to customize JSON behavior or use different
    JSON libraries.

    To implement a provider for a specific library, subclass this base
    class and implement at least :meth:`dumps` and :meth:`loads`. All
    

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key