loads_input
json.loads decodes a JSON string; json.load reads from a file-like object.
"string"parse_float
The documentation shows parse_float=decimal.Decimal to decode 1.1 as Decimal rather than the default float.
"decimal.Decimal"input_size
The documentation recommends limiting the size of untrusted JSON input because decoding can consume considerable CPU and memory.
"bounded"round_trip_keys
Non-string dictionary keys are coerced to strings during encoding. A decode after encode may not reproduce the original dictionary.
"strings"Try the example
import json
from decimal import Decimal
value = json.loads('{"amount": 1.1}', parse_float=Decimal)
assert value["amount"] == Decimal("1.1")This sample illustrates a decoder option. It does not impose an input-size limit or validate a business schema.
Source and reuse
- Original
- Python 3.13.0: json encoder and decoder
- Version / observed
- CPython v3.13.0 / 2026-11-24T04:53:54.630820+00:00
- Use conditions
- PSF License Version 2
Copyright (c) 2001-2024 Python Software Foundation; All Rights Reserved
Full license text - SHA256
- 6533f6d5be67f903194ba4b92335d079552edb69c4c8fd45d6215de60358dd8e
The hash identifies the archived source bytes retrieved from the version tag, not a publisher-issued signature. These are condensed notes with newly written examples, not a verbatim replacement for the manual.
Archived source textInspect the complete public JSON
{
"schema": "llmsdocs-editorial-v1",
"id": "decode",
"language": "en",
"revision": 1,
"edition": "2026-11-24",
"kind": "editorial",
"title": "Read JSON and check the boundary",
"intro": "Parsing is not schema validation. Keep the input size bounded and check the resulting application values yourself.",
"html_url": "https://llmsdocs.com/en/manual/decode",
"json_url": "https://llmsdocs.com/en/manual/decode.json",
"source": {
"id": "python-json-313",
"title": "Python 3.13.0: json encoder and decoder",
"url": "https://github.com/python/cpython/blob/v3.13.0/Doc/library/json.rst",
"version": "CPython v3.13.0",
"observed_at": "2026-11-24T04:53:54.630820+00:00",
"sha256": "6533f6d5be67f903194ba4b92335d079552edb69c4c8fd45d6215de60358dd8e",
"license": "PSF License Version 2",
"license_url": "https://github.com/python/cpython/blob/v3.13.0/LICENSE",
"copyright": "Copyright (c) 2001-2024 Python Software Foundation; All Rights Reserved",
"snapshot": "/manual-source/json.rst",
"license_snapshot": "/manual-source/LICENSE.txt"
},
"changes": "The source was condensed into topic notes. Examples are newly written; Korean notes are translations.",
"disclosure": "AI-assisted editorial notes, not official Python documentation or customer submissions.",
"facts": [
{
"id": "decode-1",
"key": "loads_input",
"value": "string",
"text": "json.loads decodes a JSON string; json.load reads from a file-like object.",
"source_id": "python-json-313",
"source_lines": "74-84"
},
{
"id": "decode-2",
"key": "parse_float",
"value": "decimal.Decimal",
"text": "The documentation shows parse_float=decimal.Decimal to decode 1.1 as Decimal rather than the default float.",
"source_id": "python-json-313",
"source_lines": "97-99"
},
{
"id": "decode-3",
"key": "input_size",
"value": "bounded",
"text": "The documentation recommends limiting the size of untrusted JSON input because decoding can consume considerable CPU and memory.",
"source_id": "python-json-313",
"source_lines": "21-24"
},
{
"id": "decode-4",
"key": "round_trip_keys",
"value": "strings",
"text": "Non-string dictionary keys are coerced to strings during encoding. A decode after encode may not reproduce the original dictionary.",
"source_id": "python-json-313",
"source_lines": "227-234"
}
],
"example": "import json\nfrom decimal import Decimal\nvalue = json.loads('{\"amount\": 1.1}', parse_float=Decimal)\nassert value[\"amount\"] == Decimal(\"1.1\")",
"editorial_note": "This sample illustrates a decoder option. It does not impose an input-size limit or validate a business schema."
}The source was condensed into topic notes. Examples are newly written; Korean notes are translations.