Recipe¶
pybeerxml.recipe.Recipe
¶
A complete beer recipe parsed from a BeerXML document.
Scalar fields (name, batch_size, etc.) are populated directly from
the XML. The five key brewing metrics — OG, FG, IBU, ABV, and colour —
expose both the stored XML value and an independently calculated value:
- The plain property (e.g.
recipe.og) returns the stored XML value when present and falls back to the calculated value automatically. - The
_calculatedvariant (e.g.recipe.og_calculated) always computes from the ingredient list, regardless of what the XML says.
All gravity values are also available in degrees Plato via og_plato,
og_calculated_plato, fg_plato, and fg_calculated_plato.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str | None
|
Recipe name. |
brewer |
str | None
|
Brewer's name. |
type |
str | None
|
Recipe type, e.g. |
batch_size |
float | None
|
Target batch volume in litres. |
boil_size |
float | None
|
Pre-boil volume in litres. |
boil_time |
float | None
|
Boil duration in minutes. |
efficiency |
float | None
|
Mash efficiency as a percentage. |
notes |
str | None
|
Free-text recipe notes. |
date |
str | None
|
Recipe creation date (stored as a string, e.g. |
hops |
list[Hop]
|
Hop additions. |
fermentables |
list[Fermentable]
|
Fermentable ingredients. |
yeasts |
list[Yeast]
|
Yeast strains. |
miscs |
list[Misc]
|
Miscellaneous ingredients. |
waters |
list[Water]
|
Water chemistry profiles. |
mash |
Mash | None
|
Mash profile and steps. |
style |
Style | None
|
Beer style guidelines. |
equipment |
Equipment | None
|
Equipment profile. |
Examples:
>>> from pybeerxml import Parser
>>> recipe = Parser().parse("recipe.beerxml")[0]
>>> print(recipe.name, round(recipe.og, 4), round(recipe.ibu, 1))
Simcoe IPA 1.0756 64.3
abv
property
writable
¶
ABV in percent.
Returns the value stored in the XML when available, otherwise falls
back to abv_calculated.
abv_calculated
property
writable
¶
ABV in percent, always computed from og_calculated and fg_calculated.
color
property
writable
¶
Beer colour in SRM.
Returns the value stored in the XML when available, otherwise falls
back to color_calculated.
color_calculated
property
writable
¶
Beer colour in SRM, always computed using the Morey equation.
Returns 0.0 when batch_size is not set.
fg
property
writable
¶
Final gravity in SG.
Returns the value stored in the XML when available, otherwise falls
back to fg_calculated.
fg_calculated
property
writable
¶
Final gravity in SG, always computed from og_calculated and yeast attenuation.
Uses the highest attenuation value among all yeasts. Defaults to 75 % attenuation when no yeast is present.
fg_calculated_plato
property
writable
¶
fg_calculated expressed in degrees Plato.
fg_plato
property
writable
¶
fg expressed in degrees Plato.
forced_carbonation
property
writable
¶
Whether the beer is force-carbonated (True) or priming-sugar carbonated (False).
ibu
property
writable
¶
IBU bitterness.
Returns the value stored in the XML when available, otherwise falls
back to ibu_calculated.
ibu_calculated
property
writable
¶
IBU, always computed from boil hops using the Tinseth formula.
Only hops with use == "boil" contribute. Returns 0.0 when
batch_size is not set.
og
property
writable
¶
Original gravity in SG.
Returns the value stored in the XML when available, otherwise falls
back to og_calculated.
og_calculated
property
writable
¶
Original gravity in SG, always computed from the fermentable bill.
Uses fixed efficiencies: 50 % for steep additions, 75 % for
mash additions, and 100 % for direct additions (extracts, sugars).
Returns 1.0 when batch_size is not set.
og_calculated_plato
property
writable
¶
og_calculated expressed in degrees Plato.
og_plato
property
writable
¶
og expressed in degrees Plato.