Skip to content

cdm_data_loaders.pipelines.xmltodict.pipeline

XML to dictionary pipeline for the KBase CTS.

run_xmltodict_pipeline

run_xmltodict_pipeline(
    settings: XmlToDictSettings,
) -> LoadInfo | None

Run the XML to dict pipeline on matching files in settings.input_dir.

Parameters:

Name Type Description Default
settings XmlToDictSettings

pipeline configuration

required
Source code in src/cdm_data_loaders/pipelines/xmltodict/pipeline.py
def run_xmltodict_pipeline(settings: XmlToDictSettings) -> LoadInfo | None:
    """Run the XML to dict pipeline on matching files in settings.input_dir.

    :param settings: pipeline configuration
    :type  settings: XmlToDictSettings
    """
    xmltodict_resource = build_per_file_filesystem_resource(
        settings,
        process_xml_file_to_dict,
        name="xmltodict_reader",
        parallelized=False,
    )

    return run_pipeline(
        settings=settings,
        resource=xmltodict_resource,
        **build_file_ingest_kwargs(settings, PIPELINE_NAME),
    )