JSON Module
Anonymous contributor
Anonymous contributor95 total contributions
Anonymous contributor
Published May 4, 2022Updated Sep 29, 2022
Contribute to Docs
The json
module provides tools for working with the JavaScript Object Notation (JSON) format. It can be imported with the following line:
import json
JSON in Python is based on the object-literal syntax of JavaScript. The following Python data types can be converted to JSON strings in Python:
- Booleans (
bool
type) - Dictionaries (
dict
type) - Number types (i.e.,
int
andfloat
) - Sequence types (i.e., lists and tuples)
- Strings (
str
type) NoneType
The following functions are provided by the json
module:
JSON Module
- .dump()
- Encodes a Python object as a JSON file.
- .load()
- Decodes a JSON file and returns a Python object.
All contributors
- Anonymous contributorAnonymous contributor95 total contributions
- YanisaHS34 total contributions
- StevenSwiniarski474 total contributions
- Anonymous contributor
- YanisaHS
- StevenSwiniarski
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.