Home / Function/ load() — flask Function Reference

load() — flask Function Reference

Architecture documentation for the load() function in __init__.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  b78e55af_d200_5c9a_b306_837877d89a57["load()"]
  a2a0fafc_2ea9_1b29_60c7_bc4419008a44["__init__.py"]
  b78e55af_d200_5c9a_b306_837877d89a57 -->|defined in| a2a0fafc_2ea9_1b29_60c7_bc4419008a44
  55ea84cc_e473_fddf_9541_660cc445cb55["from_file()"]
  55ea84cc_e473_fddf_9541_660cc445cb55 -->|calls| b78e55af_d200_5c9a_b306_837877d89a57
  a11c1ff7_ae84_492d_e6a8_372832d94fbf["load()"]
  b78e55af_d200_5c9a_b306_837877d89a57 -->|calls| a11c1ff7_ae84_492d_e6a8_372832d94fbf
  style b78e55af_d200_5c9a_b306_837877d89a57 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/json/__init__.py lines 108–135

def load(fp: t.IO[t.AnyStr], **kwargs: t.Any) -> t.Any:
    """Deserialize data as JSON read from a file.

    If :data:`~flask.current_app` is available, it will use its
    :meth:`app.json.load() <flask.json.provider.JSONProvider.load>`
    method, otherwise it will use :func:`json.load`.

    :param fp: A file opened for reading text or UTF-8 bytes.
    :param kwargs: Arguments passed to the ``load`` implementation.

    .. versionchanged:: 2.3
        The ``app`` parameter was removed.

    .. versionchanged:: 2.2
        Calls ``current_app.json.load``, allowing an app to override
        the behavior.

    .. versionchanged:: 2.2
        The ``app`` parameter will be removed in Flask 2.3.

    .. versionchanged:: 2.0
        ``encoding`` will be removed in Flask 2.1. The file must be text
        mode, or binary mode with UTF-8 bytes.
    """
    if current_app:
        return current_app.json.load(fp, **kwargs)

    return _json.load(fp, **kwargs)

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does load() do?
load() is a function in the flask codebase, defined in src/flask/json/__init__.py.
Where is load() defined?
load() is defined in src/flask/json/__init__.py at line 108.
What does load() call?
load() calls 1 function(s): load.
What calls load()?
load() is called by 1 function(s): from_file.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free