json
No overview available.
def json(
data: Any,
indent: int = 4
) - > string
Serializes a Python object into a JSON-formatted string with standardized indentation and sorted keys. Use this to ensure consistent formatting for configuration files or API responses.
Parameters
| Name | Type | Description |
|---|---|---|
| data | Any | The Python dictionary, list, or scalar value to be serialized into JSON format. |
| indent | int = 4 | The number of spaces used for indentation in the output string to ensure human readability. |
Returns
| Type | Description |
|---|---|
string | A UTF-8 encoded string containing the JSON representation of the input data. |