brew_tools package¶
Submodules¶
brew_tools.brew_maths module¶
-
brew_tools.brew_maths.
abv
(og: float, fg: float, adjust: bool) → float[source]¶ Calculate the ABV from the given
og
andfg
. Will automatically adjust the fg for wort correction and alcoholParameters: - og – The original gravity
- fg – The final gravity
Returns: The ABV value
-
brew_tools.brew_maths.
adjust_gravity
(og: float, fg: float) → float[source]¶ Adjust final gravity for wort correction and alcohol
Parameters: - og – original gravity as specific gravity
- fg – final gravity as specific gravity
Returns: adjusted specific gravity value
-
brew_tools.brew_maths.
adjust_gravity_volume
(vol: float, og: float, ng: float) → float[source]¶ Returns the new volume needed to achieve the desired new gravity. This is unit independent and the return value can be used for liters and or gallons.
New Volume = (Volume * original Gravity) / new Gravity
Parameters: - vol – Original volume of wort
- og – The current gravity of the wort
- ng – The desired gravity of the wort
Returns: The amount to adjust the wort volume by
-
brew_tools.brew_maths.
adjust_volume_gravity
(vol: float, og: float, new_vol: float) → float[source]¶ Calculate the new gravity after boil off or dilution to
new_vol
This is unit independent and the volume can be used for liters and or gallons.Ending Gravity = (Beginning Volume * Beginning Gravity) / End Volume
Parameters: - vol – Original volume of wort
- og – The current gravity of the wort
- new_vol – The new volume of the wort
Returns: The new gravity after boiloff or dilution
-
brew_tools.brew_maths.
apparent_attenuation
(og: float, fg: float) → float[source]¶ Calculate the apparent attenuation from the current and original gravity. via http://realbeer.com/spencer/attenuation.html
AA = 1 - AE / OE
Parameters: - og – The original gravity of the wort (1.0 to 1.2)
- fg – The current gravity of the beer
Returns: The apparent attenuation as a decimal (multiply by 100 to get percentage value)
-
brew_tools.brew_maths.
ebc_to_l
(ebc: float) → float[source]¶ Convert EBC to Lovibond https://en.wikipedia.org/wiki/Standard_Reference_Method
-
brew_tools.brew_maths.
ebc_to_srm
(ebc: float) → float[source]¶ Convert the EBC value to SRM https://en.wikipedia.org/wiki/Standard_Reference_Method
-
brew_tools.brew_maths.
fg_from_attenuation
(og: float, attenuation: float) → float[source]¶ Calculates the gravity when the beer has reached a given attenuation percentage from the original gravity. Simply an inverse solve of
apparent_attenuation
Parameters: - og – The original gravity of the wort as specific gravity
- attenuation – The percentage attenuation to achieve
Returns: The gravity when the requested attenuation has been reached
-
brew_tools.brew_maths.
infusion
(ratio: float, curr_temp: float, new_temp: float, water_temp: float, grain: float) → float[source]¶ Calculate the amount of hot water required to raise the mash temperature to a specific temperature.
From: http://howtobrew.com/book/section-3/the-methods-of-mashing/calculations-for-boiling-water-additions
Wa = (T2 - T1)(.2G + Wm)/(Tw - T2)
Parameters: - ratio – Grist ratio in quarts/lbs
- curr_temp – Current mash temperature in fahrenheit
- new_temp – The target temperature of the mash in fahrenheit
- water_temp – The temperature of the water to be added in fahrenheit
- grain – The dry weight of the grain in the mash in pounds
Returns: The amount of water at given temperature to add to achieve requested change in mash temperature
-
brew_tools.brew_maths.
keg_psi
(temp: float, co2: float) → float[source]¶ Calculate require keg pressure to carbonate liquid at
temp
withco2
volumes of CO2From http://www.wetnewf.org/pdfs/Brewing_articles/CO2%20Volumes.pdf
V = (P + 14.695) * ( 0.01821 + 0.09011*EXP(-(T-32)/43.11) ) - 0.003342
Parameters: - temp – Temperature of liquid in keg in fahrenheit
- co2 – Volume of CO2 required
Returns: The PSI value to set the regulator to
-
brew_tools.brew_maths.
l_to_ebc
(lovibond: float) → float[source]¶ Convert from Lovibond to EBC https://en.wikipedia.org/wiki/Standard_Reference_Method
-
brew_tools.brew_maths.
l_to_srm
(lovibond: float) → float[source]¶ Convert from Lovibond to EBC https://en.wikipedia.org/wiki/Standard_Reference_Method
-
brew_tools.brew_maths.
pre_boil_dme
(points: float, cur_vol: float) → float[source]¶ Calculate the amount of DME needed to raise the gravity of a given volume of wort by a given number or gravity points. Assumes DME has an extract of 1.044ppg.
Parameters: - points – Number of gravity points to raise
- cur_vol – The current volume of the wort in gallons.
Returns: The amount of DME to add to raise the gravity
-
brew_tools.brew_maths.
priming
(temp: float, beer_vol: float, co2: float) → float[source]¶ Calculate the required weight priming (table) sugar for a given volume of beer at a specific temperature for desired CO2 volume. Beer temperature should be the temperature that the beer has been at the longest.
From: http://www.straighttothepint.com/priming-sugar-calculator/
- PS = 15.195 * Vbeer * (VCO2 - 3.0378 + (0.050062 * Tferm) -
- (0.00026555 * (Tferm ^ 2))
Parameters: - temp – Temperature of beer in fahrenheit
- beer_vol – Volume of beer to prime in gallons US
- co2 – The volume of CO2 required
Returns: The amount table sugar required
-
brew_tools.brew_maths.
real_attenuation
(og: float, fg: float) → float[source]¶ Calculate the real attentuation from the original and current gravity. Takes into account the alcohol in the beer. Calculates the real extract and uses that to calculate the attenuation via http://realbeer.com/spencer/attenuation.html
RE = .1808*OE + .8192*AE RA = 1 - RE / OE
or
RA = 1 - (.1808*OE + .8192*AE) / OE
Parameters: - og – The original gravity of the wort (1.0 to 1.2)
- fg – The current gravity of the beer
Returns: The real attenuation as a decimal (multiply by 100 to get percentage value)
-
brew_tools.brew_maths.
srm_to_ebc
(srm: float) → float[source]¶ Convert the EBC value to SRM https://en.wikipedia.org/wiki/Standard_Reference_Method
-
brew_tools.brew_maths.
srm_to_l
(srm: float) → float[source]¶ Convert the SRM value to Lovibond https://en.wikipedia.org/wiki/Standard_Reference_Method
-
brew_tools.brew_maths.
strike_temp
(grain: float, vol: float, temp: float) → float[source]¶ W = Strike water temperature °F (?) R = Water to grist ratio in quarts/lb ( 40 quarts/14 lbs = 2.857) T1 = Temp. of your dry grain °F (70) T2 = Desired mash temp °F (156 – adjusted for thermal loss)
W = (.2/R)(T2-T1)+T2
brew_tools.command_line module¶
brew_tools.config module¶
brew_tools.converter module¶
brew_tools.inputs module¶
-
brew_tools.inputs.
between
(min: float, max: float) → Callable[source]¶ Returns a function to test if a value lies between min and max