Modul Documentation¶
Constants¶
-
boozelib.
ALCOHOL_DENSITY
= 0.8¶ density of alcohol (g/ml)
-
boozelib.
BLOOD_DENSITY
= 1.055¶ density of blood (g/ml)
-
boozelib.
WATER_IN_BLOOD
= 0.8¶ parts of water in blood (%)
-
boozelib.
ALCOHOL_DEGRADATION
= 0.0025¶ for kg body weight per minute (g)
Functions¶
-
boozelib.
get_blood_alcohol_content
(*, age: int, weight: int, height: int, sex: bool, volume: int, percent: float) → float[source]¶ Return the blood alcohol contents raise (per mill) for a person after a drink.
Given a drink containing volume (ml) of alcohol with the percent (vol/vol), for a person with age (years), weight (kg) and height (cm), using the formular for “female body types” if sex is true.
-
boozelib.
get_blood_alcohol_degradation
(*, age: int, weight: int, height: int, sex: bool, minutes: int = 1, degradation: Optional[float] = None) → float[source]¶ Return the alcohol degradation (per mill) for a person over minutes.
For a person with age (years), weight (kg) and height (cm), using the formular for “female body types” if sex is true, over the given minutes. If degradation is not set,
ALCOHOL_DEGRADATION
is used as default.
-
boozelib.
calculate_alcohol_weight
(*, volume: int, percent: float) → float[source]¶ Return the amount of alcohol (in gramm) contained in a drink.
Given a drink with a volume (ml) containing percent (vol/vol) alcohol.
-
boozelib.
calculate_alcohol_degradation
(*, weight: int, minutes: int = 1, degradation: Optional[float] = None) → float[source]¶ Return the alcohol degeneration (in gramm) over time.
For a person with weight (in kg) over the given minutes. If degradation is not set,
ALCOHOL_DEGRADATION
is used as default.
-
boozelib.
calculate_body_water
(*, age: int, weight: int, height: int, sex: bool) → float[source]¶ Return the amount of water (in liter) in a persons body.
For a person with age (years), weight (kg) and height (cm), using the formular for “female body types” if sex is true.