vuegen.config_manager module#

ConfigManage creates configuration files from folders and can create components for reports from YAML config files.

class vuegen.config_manager.ConfigManager(logger: Logger | None = None, max_depth: int = 2)[source]#

Bases: object

Class for handling metadata of reports from YAML config file and creating report objects.

create_yamlconfig_fromdir(base_dir: str) Tuple[Dict[str, str | List[Dict]], Path][source]#

Generates a YAML-compatible config file from a directory. It also returns the resolved folder path.

Parameters:

base_dir (str) – The base directory containing section and subsection folders.

Returns:

The YAML config and the resolved directory path.

Return type:

Tuple[Dict[str, Union[str, List[Dict]]], Path]

initialize_report(config: dict) tuple[Report, dict][source]#

Extracts report metadata from a YAML config file and returns a Report object and the raw metadata.

Parameters:

config (dict) – The report metadata obtained from a YAML config file.

Returns:

report, config – A tuple containing the Report object created from the YAML config file and the raw metadata dictionary.

Return type:

tuple[Report, dict]

Raises:
  • FileNotFoundError – If the specified file does not exist.

  • ValueError – If the YAML config file is corrupted or contains missing/invalid values.