The `json` module converts between Python objects and JSON text. `dumps`/`loads` work with strings; `dump`/`load` work with file objects.
python
import json
data = {"chain": "Base", "chainId": 8453}
text = json.dumps(data) # '{"chain": "Base", "chainId": 8453}'
parsed = json.loads(text) # back to a dictJSON only supports a subset of Python types (dict, list, str, int/float, bool, None); tuples become lists, and custom objects need a converter function passed via `default=`.
`json.dumps(data, indent=2)` pretty-prints for readability.