NAME
foodratio - calculate ingredient ratios
SYNOPSIS
$ cat recipe
1 egg wet
2 water wet
4 flour dry
$ foodratio recipe
$ foodratio --ratio id:flour recipe
$ foodratio --mass 55 --weigh group:wet recipe
DESCRIPTION
Given a list of measurements of ingredients, foodratio will calculate the ratio between those various inputs, optionally using some ingredient (or group of ingredients) as the ratio key. The weights can be recalculated based on the measurement of a particular ingredient.
The input should be in columns, with the mass (or whatever measurement) as the first column. This must be a strictly positive number. If the second column contains %
it will be ignored, on the presumption that that is a ratio. Thus the name (id) of the ingredient will come from either the second or third column. The remainder of the columns, if any, will be treated as group names that collect ingredients into groups, e.g. a custom flour
group for recipes with different types of flour, or so forth.
Options
- mass positive-number
-
Sets the mass for the weigh method; ingredient measurements will be recalculated based on this amount.
- ratio key:value
-
Sets the ingredient or ingredient group to use as the key value for the ratio calculation, e.g. flour in a bread recipe and not the default total mass. key must be
id
orgroup
. - weigh key:value
-
Sets the ingredient or ingredient group to use as the basis for the mass argument, which by default is otherwise the total mass.
EXAMPLE
Given a file containing
160 cornmeal flour dry
150 flour flour dry
11 bpowder dry
3.5 salt dry
30 sugar dry
250 milk wet
70 oil fat wet
58 egg wet
one may weigh an egg and discover that it is 55 grams, and rescale the recipe based on that
$ foodratio cornbread | grep cornmeal
160 21.84% cornmeal flour dry
$ foodratio --mass 55 --weigh id:egg cornbread | grep cornmeal
151.7 21.84% cornmeal flour dry
and know to use 152 grams of cornmeal instead of 160.
SEE ALSO
COPYRIGHT AND LICENSE
Copyright 2022 Jeremy Mates
This program is distributed under the (Revised) BSD License: https://opensource.org/licenses/BSD-3-Clause