from typing import Dict


def column_dict_parser(num_comps: int, csv_dict: Dict) -> Dict:
    """Sorts data and separates out for each compound"""
    comps_shift_data = {}
    for i in range(1, num_comps + 1):
        # Creates list of possible variables for a compound
        possible_variables = [
            str(i) + "_cshift",
            str(i) + "_hshift",
            str(i) + "_multi",
            str(i) + "_coupling",
        ]
        # Find the variables for a single compound
        # from the input data
        found_variables = {
            key: val
            for key, val in csv_dict.items()
            if key in possible_variables and bool(csv_dict.get(key))
        }
        comps_shift_data[str(i)] = found_variables
    return comps_shift_data