|
| 1 | +# Welcome to the simple recipe calculator |
| 2 | + |
| 3 | +## Quickstart |
| 4 | + |
| 5 | +The example yml files you will find in the repository (no guarantee for food values; fetch your own): |
| 6 | + - [food.yml](food.yml) |
| 7 | + - [fruit_cocktail.yml](fruit_cocktail.yml) |
| 8 | + |
| 9 | +``` |
| 10 | +python pyfood.py --yml-food=food.yml --yml-recipe=fruit_cocktail.yml |
| 11 | +
|
| 12 | +Rezept: Frucht Cocktail für 3 Person(en) |
| 13 | +____________________ ____ _____ _____ _____ _____ |
| 14 | + Name # kcal KH E F |
| 15 | +____________________ ____ _____ _____ _____ _____ |
| 16 | + Kiwi 200 124.0 18.2 2.0 1.2 |
| 17 | + Orange 300 141.0 24.9 3.0 0.6 |
| 18 | + Apfel 400 260.0 57.6 1.2 0.4 |
| 19 | + Himbeeren 350 150.5 16.8 4.5 1.1 |
| 20 | + Heidelbeeren 250 97.5 15.0 2.5 0.0 |
| 21 | + Zitrone 200 66.0 6.0 2.8 1.2 |
| 22 | +____________________ ____ _____ _____ _____ _____ |
| 23 | + Summe 839.0 138.5 16.0 4.5 |
| 24 | + Pro Person 279.7 46.2 5.3 1.5 |
| 25 | + Anteil % 87.1 10.1 2.8 |
| 26 | +
|
| 27 | +``` |
| 28 | + |
| 29 | +You can see the name and the quantity of each food and |
| 30 | +the calculated ingredients. As an example for the Kiwi |
| 31 | +the double of the ingredient values is shown as specified |
| 32 | +in the food yml file. |
| 33 | + |
| 34 | +At the end you can see the sum per ingredient and the |
| 35 | +sum per ingredient value calculated for one person. |
| 36 | + |
| 37 | +Finally you see the percentages. Obviously the example is |
| 38 | +not really low carb :) |
| 39 | + |
| 40 | +Hint: there are a lot of online locations to find those |
| 41 | +food ingredients but usually buying food you often have |
| 42 | +such information available on the article somewhere with |
| 43 | +some exceptions of course. |
| 44 | + |
| 45 | +My personal rules I try to follow: |
| 46 | + - at least 50% protein for a recipe (in most cases) |
| 47 | + - avoid to eat more large calories as you should (can be roughly calculated -> internet) |
| 48 | + - avoid fast food; buying fresh things |
| 49 | + - do some sport (no athletic; just a litte bit does help; you can do it at home) |
| 50 | + - we (my wife and me) are making our own low carb bread (as an example) |
| 51 | + |
| 52 | +## The structure of the food file |
| 53 | + |
| 54 | +Quite simple it's a list of entries like following: |
| 55 | + |
| 56 | +``` |
| 57 | +- name: Some Food |
| 58 | + large_calories: 1.1 |
| 59 | + fat: 2.2 |
| 60 | + carb:3.3 |
| 61 | + protein: 3.3 |
| 62 | +``` |
| 63 | + |
| 64 | +It's always the ingredients related to 100 gram or |
| 65 | +100 millilitre of a concrete food. The tool does |
| 66 | +not check that the sum of fat, carb and protein |
| 67 | +is less or equal that limit. |
| 68 | + |
| 69 | +You can find an example file in the repository. |
| 70 | +Please note: no guarantee on the value there; |
| 71 | +I fetched them from somewhere for testing purpose only. |
| 72 | + |
| 73 | +## The structure of one recipe file |
| 74 | + |
| 75 | +You would have to organise one recipe per file and |
| 76 | +one file looks like following: |
| 77 | + |
| 78 | +``` |
| 79 | +--- |
| 80 | +name: Frucht Cocktail |
| 81 | +persons: 3 |
| 82 | +food: |
| 83 | + - { name: Kiwi, quantity: 200 } |
| 84 | + - { name: .*nge, quantity: 300 } |
| 85 | + - { name: Ap.*, quantity: 400 } |
| 86 | + - { name: Him.*, quantity: 350 } |
| 87 | + - { name: Heid.*, quantity: 250 } |
| 88 | + - { name: Zi.*, quantity: 200 } |
| 89 | +``` |
| 90 | + |
| 91 | +Of course you have name (title) and you specify |
| 92 | +for how many person the recipe is. Finally |
| 93 | +you have a food list where you specify the food |
| 94 | +and how many gram/millilitre you take. |
| 95 | + |
| 96 | +The name is a Python compatible regular expression |
| 97 | +so that you do not have to specify the full name. |
| 98 | + |
0 commit comments