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 and fg. Will automatically adjust the fg for wort correction and alcohol

Parameters:
  • 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.c_to_f(c: float) → float[source]

Convert celcius to fahrenheit

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.f_to_c(f: float) → float[source]

Convert fahrenheit to celcius

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.g_to_l(gallon: float) → float[source]

Convert US gallons to liters

brew_tools.brew_maths.g_to_oz(g: float) → float[source]

Convert grams to ounces

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 with co2 volumes of CO2

From 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.kg_to_lbs(kg: float) → float[source]

Convert kilograms to pounds

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_g(liter: float) → float[source]

Convert liters to gallons US

brew_tools.brew_maths.l_to_q(liter: float) → float[source]

Convert liters to quarts US

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.lbs_to_kg(lbs: float) → float[source]

Convert kilograms to pounds

brew_tools.brew_maths.lbs_to_oz(lbs: float) → float[source]

Convert lbs to ounces

brew_tools.brew_maths.oz_to_g(oz: float) → float[source]

Convert ounces to grams

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.brew_maths.to_brix(value: float) → float[source]

Convert gravity value to brix value

brew_tools.brew_maths.to_plato(sg: float) → float[source]

Convert specific gravity to plato (extract)

(-1 * 616.868) + (1111.14 * sg) – (630.272 * sg^2) + (135.997 * sg^3)

brew_tools.brew_maths.to_sg(plato: float) → float[source]

Convert from plato to specific gravity

brew_tools.command_line module

brew_tools.config module

brew_tools.converter module

brew_tools.converter.print_colour(value: float) → None[source]
brew_tools.converter.print_gravity(value: float) → None[source]
brew_tools.converter.print_mass(value: float) → None[source]
brew_tools.converter.print_volume(value: float) → None[source]

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

brew_tools.inputs.get_choice(prompt: str, choices: List[str]) → int[source]
brew_tools.inputs.get_gravity_input(prompt: str) → float[source]

Prompt for an input for gravity and validated to be between 1.0 and 1.2

Parameters:
  • ctx – Click context
  • prompt – User prompt. Will be checked for bounds
Returns:

entered value as float

brew_tools.inputs.get_unit_input(unit: str, prompt: str) → float[source]

Prompt for an input for temperature and automatically resolve unit (Celcius or Fahrenheit)

Parameters:
  • unit – unit to use
  • prompt – User prompt. Correct unit will be appended
Returns:

entered value as float

Module contents