Calorie tracker and diet planner
# pantry [[food]] name = 'rolled-oats' serving-size = '100g' protein = 13.2 carbs = 67.7 fat = 6.5 # meals [[meal]] date = 2018-05-31 time = 10:15:00 # eat 150g rolled oats [[meal.portion]] food = 'oats' servings = 1.5
export RAKULIB=lib bin/sustenance --date=2018-05-31 gen-macros sustenance.toml
use Sustenance; my Date $date .= new('2018-05-31'); Sustenance.new(:file<sustenance.toml>).gen-macros($date);
Make a diet plan
Make a diet plan for a lightly active male athlete, age 31, weighing 59 kg at 175.26 cm.
export RAKULIB=lib bin/sustenance \ --weight=59.4206 \ --height=175.26 \ --age=31 \ --gender=male \ --activity-level=lightly-active \ gen-diet-plan
use Sustenance::DietPlan; Sustenance::DietPlan.new( :weight(59), :height(175.26), :age(31), :gender<male>, :activity-level<lightly-active> ).gist;
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,
||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 fiber includes both soluble and insoluble fiber
Creates rudimentary diet plan for weight maintenance, muscle gains and fat loss.
First estimates Basal Metabolic Rate (BMR) with the Mifflin St Jeor equation.
Then estimates Total Daily Energy Expenditure (TDEE) by taking the product of BMR and the appropriate Katch-McArdle multiplier for a given activity level.
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 of carbohydrates.
This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.