extended_data.primitives.formats.yaml.utils

This module provides utility functions for YAML encoding and decoding.

It includes functions to decode YAML strings, encode Python objects to YAML, and check if data is a YAML tagged object.

Module Contents

Functions

decode_yaml

Decode YAML data into a Python object.

encode_yaml

Encode a Python object into a YAML string.

is_yaml_data

Check if the data is a YAML tagged object.

API

extended_data.primitives.formats.yaml.utils.decode_yaml(yaml_data: str | memoryview | bytes | bytearray) Any

Decode YAML data into a Python object.

Args: yaml_data (str | memoryview | bytes | bytearray): The YAML data to decode.

Returns: Any: The decoded Python object.

extended_data.primitives.formats.yaml.utils.encode_yaml(raw_data: Any) str

Encode a Python object into a YAML string.

Args: raw_data (Any): The Python object to encode.

Returns: str: The encoded YAML string.

extended_data.primitives.formats.yaml.utils.is_yaml_data(data: Any) bool

Check if the data is a YAML tagged object.

Args: data (Any): The data to check.

Returns: bool: True if the data is a YAML tagged object, False otherwise.