On this page
article
json — JSON Encoder/Decoder
Serialize Python objects to JSON.
Overview
Serialize Python objects to JSON.
Quick Example
json.dumps({'a': 1}, indent=2)
json.loads(text)
When to Use
Use this module when you need built-in support without adding third-party dependencies.
Common Tasks
- Read the official docs: docs.python.org/3/library/json.html
- Combine with related modules in the Cookbook
- Prefer stdlib before reaching for PyPI packages