LLMSdocs

PYTHON 3.13.0 / EDITORIAL NOTE / 2026-11-24 / v1

Format a document for inspection

Readable output helps a reviewer inspect a document. Compact output changes whitespace, not the purpose of the data.

AI-assisted editorial notes, not official Python documentation or customer submissions.

indent

A positive integer indent inserts that many spaces per level. The documentation demonstrates indent=4 for pretty printing.

JSON /facts/0/value
4

[1] Source lines 54-61, 179-184

compact_separators

Use separators=(',', ':') to eliminate separator whitespace for compact output.

JSON /facts/1/value
[",",":"]

[1] Source lines 189-192

cli

The json.tool command validates and pretty-prints JSON from the shell. Invalid unquoted property names produce an error.

JSON /facts/2/value
"python -m json.tool"

[1] Source lines 119-128

framed

JSON is not a framed protocol. Repeated dump calls to the same file produce an invalid JSON file.

JSON /facts/3/value
false

[1] Source lines 212-216

Try the example

import json
record = {"name": "sample", "enabled": True}
print(json.dumps(record, indent=4))
print(json.dumps(record, separators=(",", ":")))

Formatting is not a signature or a guarantee that two independently serialized documents have identical bytes. Compare the values you need, or define a separate byte-level contract.

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 text
Inspect the complete public JSON
{
  "schema": "llmsdocs-editorial-v1",
  "id": "format",
  "language": "en",
  "revision": 1,
  "edition": "2026-11-24",
  "kind": "editorial",
  "title": "Format a document for inspection",
  "intro": "Readable output helps a reviewer inspect a document. Compact output changes whitespace, not the purpose of the data.",
  "html_url": "https://llmsdocs.com/en/manual/format",
  "json_url": "https://llmsdocs.com/en/manual/format.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": "format-1",
      "key": "indent",
      "value": 4,
      "text": "A positive integer indent inserts that many spaces per level. The documentation demonstrates indent=4 for pretty printing.",
      "source_id": "python-json-313",
      "source_lines": "54-61, 179-184"
    },
    {
      "id": "format-2",
      "key": "compact_separators",
      "value": [
        ",",
        ":"
      ],
      "text": "Use separators=(',', ':') to eliminate separator whitespace for compact output.",
      "source_id": "python-json-313",
      "source_lines": "189-192"
    },
    {
      "id": "format-3",
      "key": "cli",
      "value": "python -m json.tool",
      "text": "The json.tool command validates and pretty-prints JSON from the shell. Invalid unquoted property names produce an error.",
      "source_id": "python-json-313",
      "source_lines": "119-128"
    },
    {
      "id": "format-4",
      "key": "framed",
      "value": false,
      "text": "JSON is not a framed protocol. Repeated dump calls to the same file produce an invalid JSON file.",
      "source_id": "python-json-313",
      "source_lines": "212-216"
    }
  ],
  "example": "import json\nrecord = {\"name\": \"sample\", \"enabled\": True}\nprint(json.dumps(record, indent=4))\nprint(json.dumps(record, separators=(\",\", \":\")))",
  "editorial_note": "Formatting is not a signature or a guarantee that two independently serialized documents have identical bytes. Compare the values you need, or define a separate byte-level contract."
}

The source was condensed into topic notes. Examples are newly written; Korean notes are translations.