2025-07-24 22:27:13 -06:00
|
|
|
# python -m json.tool
|
|
|
|
|
|
|
|
|
|
> Validate and pretty-print JSON data.
|
|
|
|
|
> Part of Python's standard library.
|
|
|
|
|
> More information: <https://docs.python.org/library/json.html#module-json.tool>.
|
|
|
|
|
|
|
|
|
|
- Pretty-print JSON from a file:
|
|
|
|
|
|
|
|
|
|
`python -m json.tool {{path/to/file.json}}`
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Validate and pretty-print JSON from `stdin`:
|
2025-07-24 22:27:13 -06:00
|
|
|
|
|
|
|
|
`echo '{{{"key": "value"}}}' | python -m json.tool`
|