Calorie tracker and diet planner
name = 'rolled-oats'
serving-size = '100g'
protein = 13.2
carbs = 67.7
fat = 6.5
date = 2018-05-31
time = 10:15:00
# eat 150g rolled oats
food = 'oats'
servings = 1.5
bin/sustenance --date=2018-05-31 gen-macros sustenance.toml
my Date $date .= new('2018-05-31');
Make a diet plan
Make a diet plan for a lightly active male athlete, age 31, weighing 59
kg at 175.26 cm.
Processes daily caloric intake from TOML meal
journal formatted per the synopsis (see also:
The Sustenance meal journal must consist of at least one food entry
and at least one meal entry.
Each food entry must have:
|name of food||string|
|grams of protein per serving||number|
|grams of total carbohydrates¹ per serving||number|
|grams of fat per serving||number|
Each food entry may have:
|alternative name by which food is known||string|
|alternative names by which food is known||array of strings|
|grams of total fiber² per serving||number|
|grams of total fiber per serving, |
$insoluble-fiber / $total-fiber
|array of floats or array of integers|
|grams of alcohol per serving||number|
|source of macronutrient data||string|
Each meal entry must have:
|see below||array of hashes|
Each meal portion must have:
|name of food||string|
|number of servings of food||number|
¹: total carbohydrates includes all types
of carbohydrates - sugars, sugar alcohols, starches and dietary
fiber - per USA food labels (see: international food labeling
²: total fiber includes both soluble and insoluble fiber
Creates rudimentary diet plan for weight maintenance, muscle gains and
First estimates Basal Metabolic Rate (BMR) with the Mifflin St Jeor
Then estimates Total Daily Energy Expenditure (TDEE) by taking the
product of BMR and the appropriate Katch-McArdle multiplier for a given
Adds 250-500 calories on top of TDEE to estimate caloric intake
requirements for muscle gains.
Subtracts 250-500 calories from TDEE to estimate caloric intake
requirements for fat loss.
Recommends obtaining 1.4-1.6 grams of protein per kilogram body weight.
Recommends obtaining 20-35% of daily calories from healthy sources of fat.
Recommends obtaining remainder of daily calories from healthy sources
This is free and unencumbered public domain software. For more
information, see http://unlicense.org/ or the accompanying UNLICENSE file.