nagasurendra's picture
Create menu.py
f0ce3bc verified
raw
history blame
356 Bytes
import pandas as pd
from utils.file_initializer import MENU_FILE
def load_menu(preferences=None, allergies=None):
menu = pd.read_excel(MENU_FILE)
if preferences:
menu = menu[menu["Preferences"].str.contains(preferences, na=False)]
if allergies:
menu = menu[~menu["Allergens"].str.contains(allergies, na=False)]
return menu