import pathlib


def find_component(path: pathlib.PurePath):
    """
    Extracts the likely component name of a CSV file based on the path to it
    :param path: path to a CSV file
    :return: likely component to use
    """
    # pylint: disable=no-else-return
    if path.parent.name.isnumeric():
        # Probably a version directory
        return path.parents[1].name
    else:
        return path.parent.name