5.3.1.9.1.4.1. cli.cmd_etl.cmds.convert_helper.converter_setup

cli.cmd_etl.cmds.convert_helper.converter_setup(config: dict) Converter

Create and return a configured Converter instance.

This function validates the provided configuration’s “conversion” section, builds a ConversionSettings object from it, and then instantiates a Converter using the given data_path and recursive flags.

Parameters:

config

A dictionary containing:

  • ”conversion”: dict with keys:
    • ”input_format”: expected input format (InputFormats member).

    • ”output_format”: desired output format (OutputFormats member).

    • ”skip_footer”: optional int, number of footer lines to skip (for DTA).

  • ”data_path”: pathlib.Path pointing to a file or directory.

  • ”recursive”: bool indicating whether to traverse subdirectories.

Returns:

A Converter that is ready to execute the conversion.

Exit behavior:

If validation fails, validate_converter_config prints an error via recho and terminates the process with sys.exit(1).