import csv


def load_endpoints(filepath):
    """Load the endpoint definitions and return a list of enpoint infos"""
    with open(filepath) as ff:
        reader = csv.DictReader(ff)

        # Keep only necessary columns
        endpoints = []
        for row in reader:
            endpoints.append({
                'NAME': row['NAME'],
                'OMIT': row['OMIT'],
                'CORE_ENDPOINTS': row['CORE_ENDPOINTS']
            })

    return endpoints