A Python module containing a couple of functions to calculate the blood alcohol content of people.

It’s at home at GitHub:


The two main functions are:

boozelib.get_bac(age, weight, height, sex, volume, percent)[source]

Returns the Blood Alcohol Content (raise) for a person (described by the given attributes) after a drink containing volume ml of alcohol with the given percent (vol/vol).

boozelib.get_degradation(age, weight, height, sex, minutes)[source]

Returns the alcohol degradation (per mill) of a person with the given stats in the given number of minutes.

You can browse the full documentation online. Or you can get help with pydoc boozelib, if you already got boozelib installed.


>>> from boozelib import get_bac, get_degradation
>>> get_bac(32, 96, 186, False, 500, 4.9)
>>> get_bac(32, 48, 162, True, 500, 4.9)
>>> get_degradation(32, 96, 186, False, 60)
>>> get_degradation(32, 48, 162, True, 60)

Thanks and Contributions

  • Big hugs to Mathilda for hanging around and helping me figuring out all that math and biology stuff.

If you find any bugs, issues or anything, please use the issue tracker on GitHub.

Project Versions

Table Of Contents

Next topic


This Page