Config IO
The module contains the IO functions.
The IO functions are used to read and write the configuration file.
construct_config
Construct the configuration objects.
Source code in src/simple_config_builder/config_io.py
parse_config
Parse the configuration file.
Parameters
config_file: The configuration file path. config_type: The configuration file type.
Returns
The configuration dictionary.
Source code in src/simple_config_builder/config_io.py
parse_json
Parse the JSON configuration file.
If there is currently no configuration file, it will return an empty dictionary.
Parameters
config_file: The configuration file path.
Returns
The parsed json data.
Source code in src/simple_config_builder/config_io.py
parse_toml
Parse the TOML configuration file.
Parameters
config_file: The configuration file path.
Returns
The parsed toml data.
Source code in src/simple_config_builder/config_io.py
parse_yaml
Parse the YAML configuration file.
If there is currently no configuration file, it will return an empty dictionary.
Parameters
config_file: The configuration file path.
Returns
The parsed yaml data.
Source code in src/simple_config_builder/config_io.py
to_dict
Convert an object to a dictionary.
Parameters
obj: The object to convert.
Returns
The converted dictionary.
Source code in src/simple_config_builder/config_io.py
write_config
Write the configuration file.
Parameters
config_file: The configuration file path. data: The configuration data. config_type: The configuration file type.
Source code in src/simple_config_builder/config_io.py
write_json
Write the JSON configuration file.
Parameters
config_file: The configuration file path. config_data: The configuration data.
Source code in src/simple_config_builder/config_io.py
write_toml
Write the TOML configuration file.
Parameters
config_file: The configuration file path. config_data: The configuration data.
Source code in src/simple_config_builder/config_io.py
write_yaml
Write the YAML configuration file.
Parameters
config_file: The configuration file path. config_data: The configuration data.