nicetoolbox.utils.check_and_exception.load_dict_keys_values

nicetoolbox.utils.check_and_exception.load_dict_keys_values(command: str, config_name: str) list[source]

Load keys or values from a .toml file based on the given command.

Parameters:
  • command (str) –

    A string in the format ‘token:file:key(s)’ or ‘token:file’. ‘token’ should be either ‘keys’ or ‘values’. ‘file’ is the path to the .toml file. ‘key(s)’ is an optional parameter specifying the nested keys in the

    .toml file.

  • config_name (str) – The name of the configuration for error logging.

Returns:

A list of keys or values from the .toml file based on the given command.

Return type:

list

Raises:
  • NotImplementedError – If the file format is not supported.

  • AssertionError – If the token is neither ‘keys’ nor ‘values’.