extended_data.primitives.formats.toml

TOML Utilities Module.

This module provides utilities for encoding and decoding TOML data using tomlkit.

Module Contents

Functions

decode_toml

Decodes a TOML string into a Python object using tomlkit.

encode_toml

Encodes a Python object into a TOML string using tomlkit.

API

extended_data.primitives.formats.toml.decode_toml(toml_data: str | memoryview | bytes | bytearray) Any

Decodes a TOML string into a Python object using tomlkit.

Args: toml_data (str | memoryview | bytes | bytearray): The TOML string to decode.

Returns: Any: The decoded Python object with any special types processed.

extended_data.primitives.formats.toml.encode_toml(raw_data: Any) str

Encodes a Python object into a TOML string using tomlkit.

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

Returns: str: The encoded TOML string.