SDK Reference
encoding
The encoding
module provides functions for working with encoding formats like JSON and YAML.
Allowed in
All functions
Usage
Load the module:
Example
API Reference
json.encode(data)
Encodes the given value to JSON and returns the result as a string.
Arguments
data
: The value to encode (can be dict, list, string, number, bool, or None)
Returns
- JSON string representation of the data
json.decode(data)
Decodes the provided JSON string and returns the resulting value.
Arguments
data
: JSON string to decode
Returns
- Decoded value (dict, list, string, number, bool, or None)
yaml.encode(data)
Encodes the given value to YAML and returns the result as a string.
Arguments
data
: The value to encode (can be dict, list, string, number, bool, or None)
Returns
- YAML string representation of the data
yaml.decode(data)
Decodes the provided YAML string and returns the resulting value.
Arguments
data
: YAML string to decode
Returns
- Decoded value (dict, list, string, number, bool, or None)