brew.grains

class brew.grains.Grain(name, color=None, ppg=None, hwe=None)

A representation of a type of grain.

Parameters:
  • name (str) – The name of the grain
  • color (float) – The color of the grain in SRM
  • ppg (float) – The potential points per gallon
  • hwe (float) – The hot water extract value
Raises:
  • Exception – If color is not provided
  • Exception – If ppg or hwe is not provided
  • Exception – If both ppg and hwe are provided
format()
get_working_yield(percent_brew_house_yield)

Get Working Yield

Parameters:percent_brew_house_yield (float) – The Percent Brew House Yield
Returns:The working yield
Return type:float
to_dict()
to_json()
class brew.grains.GrainAddition(grain, weight=None, grain_type=u'cereal', units=u'imperial')

A representation of the grain as added to a Recipe.

Parameters:
  • grain (Grain) – The Grain object
  • weight (float) – The weight of the grain addition
  • grain_type (str) – The type of the grain being used
  • units (str) – The units
change_units()

Change units of the class from one type to the other

Returns:Grain Addition in new unit type
Return type:GrainAddition
format()
get_cereal_weight()

Get the weight of the addition in cereal weight

Returns:Cereal weight
Return type:float
get_dry_weight()

Get the weight of the addition in Dry Malt Extract weight

Returns:Dry weight
Return type:float
get_lme_weight()

Get the weight of the addition in Liquid Malt Extract weight

Returns:LME weight
Return type:float
get_weight_map()

Get map of grain weights by type

Returns:Grain weights
Return type:dict
set_units(units)

Set the units and unit types

Parameters:units (str) – The units
to_dict()
to_json()
classmethod validate(grain_data)