import csv


def read_objects_csv(filename):
    """Takes a CSV with headings and converts each row to a dict. Useful for populating create_network()

    :param filename: Full filename of the CSV
    :type filename: str
    :return: A list of dicts, each dict is a row from the CSV, with the heading as key and column as value
    :rtype: list
    """
    objs = []
    with open(filename) as objects_csv:
        objects_dict = csv.DictReader(objects_csv)
        for obj in objects_dict:
            objs.append(obj)
    return objs