calypso.utils.to_toml module

calypso.utils.to_toml.dict_to_toml(data_dict, parent_key='')

Convert a Python dictionary to a TOML formatted string, skipping keys with None values.

Parameters:
  • data_dict (dict) – The Python dictionary to convert to TOML format.

  • parent_key (str, optional) – The key path leading to the current data_dict (used internally for recursion).

Returns:

The TOML formatted string.

Return type:

str

calypso.utils.to_toml.format_list(value_list)

Format a Python list into a TOML-compatible list string.

Parameters:

value_list (list) – The list to format.

Returns:

The TOML-formatted string representation of the list.

Return type:

str

calypso.utils.to_toml.format_value(value)

Format a Python value into a TOML-compatible string representation.

Parameters:

value (any) – The value to format.

Returns:

The TOML-formatted string representation of the value.

Return type:

str

calypso.utils.to_toml.write_toml(inputdat_dict, output_file)