Skip to content

Hop

pybeerxml.hop.Hop

A hop addition in a beer recipe.

Attributes:

Name Type Description
name str | None

Hop variety name.

alpha float | None

Alpha acid percentage.

amount float | None

Weight in kilograms.

use str | None

When the hop is added — "boil", "dry hop", "aroma", etc.

form str | None

Physical form — "pellet", "whole", or "plug".

time float | None

Contact time in minutes (boil time, dry-hop duration, etc.).

type str | None

Hop type — "bittering", "aroma", or "both".

beta float | None

Beta acid percentage.

origin str | None

Country of origin.

notes str | None

Free-text notes.

bitterness(ibu_method, early_og, batch_size)

Calculate the IBU contribution of this hop addition.

Parameters:

Name Type Description Default
ibu_method str

Formula to use — "tinseth" or "rager".

required
early_og float

Original gravity at the start of the boil (e.g. 1.050).

required
batch_size float

Batch volume in litres.

required

Returns:

Type Description
float

IBU contribution as a float.

Raises:

Type Description
ValueError

If time, alpha, or amount is None.

ValueError

If ibu_method is not "tinseth" or "rager".

utilization_factor()

Utilization multiplier for hop form.

Pellet hops are approximately 15 % more efficient than whole hops.

Returns:

Type Description
float

1.15 for pellets, 1.0 for all other forms.