Created
July 13, 2016 11:38
-
-
Save arthirad/11cd977723b307e3243f69e64acac7d8 to your computer and use it in GitHub Desktop.
Limiting my day to day choices with a quick recipe generator that helps take the guesswork out of my day to day!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import numpy | |
from utils import * | |
from random import shuffle | |
staples = ['potatoes', 'onions', 'ginger', 'cheese', 'eggs','yogurt'] | |
carb = ['bread', 'noodles', 'rice', 'quinoa'] | |
other = ['gochujang', 'ketchup'] #condiments | |
veggies = ['zuchinni', 'summer squash', 'green and purple beans', 'spring onion', 'cucumber', | |
'tomatoes', 'water spinach', 'moringa', 'mixed kale'] | |
meal = ['breakfast', 'lunch', 'dinner'] | |
this_meal = is_meal_valid('Which meal are you having?', meal) | |
if this_meal: | |
sys.stdout.write('\nGreat! Let\'s prep %s!\n\n' % this_meal) | |
#assume staples and carb combprise a 'current_pantry,' | |
#print current pantry | |
current_pantry = staples + carb + other | |
print_current_pantry(current_pantry) | |
#determine if youre out of any pantry items | |
negative_staples = '' | |
out_of = is_input_valid('\n\nAre you out of any items in your pantry?', None) | |
if out_of: | |
negative_staples = raw_input('\nWhat are you out of? (separated by space) ') #TODO add check to make sure items are in current_pantry | |
negative_staples = negative_staples.split() | |
current_pantry = list(set(current_pantry)^set(negative_staples)) | |
for i in negative_staples: | |
if i in staples: | |
staples.remove(i) | |
elif i in carb: | |
carb.remove(i) | |
elif i in other: | |
other.remove(i) | |
sys.stdout.write('Ok. I\'ve removed %s. \n' % ' and '.join(negative_staples)) | |
sys.stdout.write('Let me think about what you should eat for %s...\n\n' % this_meal) | |
my_meal = 'Hm, does not look like we\'re having a meal today. Pleaes check your inputs!\n\n' | |
if this_meal == 'breakfast': | |
my_meal = make_breakfast(current_pantry, veggies) | |
else: | |
my_meal = make_lunch_or_dinner(carb, staples, current_pantry, veggies) | |
sys.stdout.write('\n\n*************************\n\n') | |
sys.stdout.write(my_meal) | |
sys.stdout.write('\n\n*************************\n\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment