import csv

from lml.plugin import PluginInfo

from moban import constants


@PluginInfo(constants.DATA_LOADER_EXTENSION, tags=["custom"])
def open_custom(file_name):
    with open(file_name, "r") as data_csv:
        csvreader = csv.reader(data_csv)
        rows = []
        for row in csvreader:
            rows.append(row)

        data = dict(zip(rows[0], rows[1]))
        return data
