from src.items.helpers.categories import Categories

def factory(fixtures):
    items = []
    for fixture in fixtures:
        try:
            item = Categories[fixture['category']].value(
                fixture['name'], fixture['sell_in'], fixture['quality'])
            items.append(item)
        except:
            item = Categories['normal'].value(
                fixture['name'], fixture['sell_in'], fixture['quality'])
            items.append(item)
    return items