This repository is depracted in favor of grocery-shopper. It will be deleted in the middle distant future. If you like the repository, consider switching. You can keep your recipes and the res/ingredient_category_url.csv
file. If any questions arise, feel free to open an issue!
No "What should I eat for dinner today?" and manually buying ever again! Recipes are selected randomly and a firefox instance will open to buy the necessary ingredients online1 – Deciding and grocery shopping in one step!
Clone the git repository (wherever you like):
git clone https://github.com/PhilippFeO/recipe_selector
make select_recipes.sh
executable via chmod x select_recipes.sh
and go.
- Create a firefox profile for grocery shopping only [1].
1.1. Insert the path in
main.py
. The variable is the topmost after theimport
section. (Background: By using a distings profile, one can keep cookies and login information. The program also won't interfere with your default browser profile you are using on a daily basis.) - Place your recipes as
yaml
files in arecipes/
folder (you may create one). (Disclaimer: This is subject to change in the near future.)
2.1. Your recipe should have the following structure:
ingredients:
- name: Spaghetti
quantity: 250g
- name: Tomato(s)
quantity: 5
...
preparation:
- 1. Cook the Spaghetti.
- 2. Produce a Tomatosauce.
...
- Start
./select_recipes.sh
- The programm will parse the randomly chosen recipes. If it can't find an URL for the specific
Ingredient
, it will ask you to manually add one via the command line. The submitted links are saved and reused separately from the recipe. - After all URLs were collected, Firefox opens the URLs in tabs using your new profile.
It is also possible to provide the URL as a field (url
) in the yaml
of the recipe but then we have to provide the URL each time using the Ingredient
. By having a separate file storing Ingredient.name
(.name
since only the string is used in this case) and it's URL, we have one source of truth. This is quite handy if URLs change, because then we have to edit it once and not across each recipe. The combination is saved under res/ingredient_category_url.csv
. Having plain text/csv and no binary gives us the opportunity to easily make changes afterwards. An additional benefit is that this speeds up creating a new recipe since most Ingredient
s are already provided with an URL and wo don't have to insert the same information again and again.
- I have written a source for Neovim, ie. nvim-cmp which completes the ingredients. You can find it in my Repos or here. Having syntax completion provides you from typos, duplication and remembering which
Ingredient
is already with URL available.
[1]: If you don't know how to create a new profile, check: https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles?redirectslug=profile-manager-create-and-remove-firefox-profiles&redirectlocale=en-US Keep in mind, that this profile is automatically the default one. So, you have to select your previous profile as standard afterwards. The directory of the profile(s) are also listed on this page. Just copy and paste.
Footnotes
-
At least in Germany it is possible to buy food online at some vendors like Rewe, knuspr and Flink. Especially Rewe is handy, because an App is not necessary and can be done with the desktop browser. ↩