loads() — flask Function Reference
Architecture documentation for the loads() function in __init__.py from the flask codebase.
Entity Profile
Dependency Diagram
graph TD 9f175f92_04cc_1b7c_fbf0_a4e8f8a10306["loads()"] a2a0fafc_2ea9_1b29_60c7_bc4419008a44["__init__.py"] 9f175f92_04cc_1b7c_fbf0_a4e8f8a10306 -->|defined in| a2a0fafc_2ea9_1b29_60c7_bc4419008a44 e5ada208_dbe0_c092_5c6e_6d8eff3adee0["from_prefixed_env()"] e5ada208_dbe0_c092_5c6e_6d8eff3adee0 -->|calls| 9f175f92_04cc_1b7c_fbf0_a4e8f8a10306 8b885d9c_52b6_0466_0055_5ab6516c615c["loads()"] 9f175f92_04cc_1b7c_fbf0_a4e8f8a10306 -->|calls| 8b885d9c_52b6_0466_0055_5ab6516c615c style 9f175f92_04cc_1b7c_fbf0_a4e8f8a10306 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/flask/json/__init__.py lines 77–105
def loads(s: str | bytes, **kwargs: t.Any) -> t.Any:
"""Deserialize data as JSON.
If :data:`~flask.current_app` is available, it will use its
:meth:`app.json.loads() <flask.json.provider.JSONProvider.loads>`
method, otherwise it will use :func:`json.loads`.
:param s: Text or UTF-8 bytes.
:param kwargs: Arguments passed to the ``loads`` implementation.
.. versionchanged:: 2.3
The ``app`` parameter was removed.
.. versionchanged:: 2.2
Calls ``current_app.json.loads``, allowing an app to override
the behavior.
.. versionchanged:: 2.0
``encoding`` will be removed in Flask 2.1. The data must be a
string or UTF-8 bytes.
.. versionchanged:: 1.0.3
``app`` can be passed directly, rather than requiring an app
context for configuration.
"""
if current_app:
return current_app.json.loads(s, **kwargs)
return _json.loads(s, **kwargs)
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does loads() do?
loads() is a function in the flask codebase, defined in src/flask/json/__init__.py.
Where is loads() defined?
loads() is defined in src/flask/json/__init__.py at line 77.
What does loads() call?
loads() calls 1 function(s): loads.
What calls loads()?
loads() is called by 1 function(s): from_prefixed_env.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free