Skip to main content

A BeerXML Parser

Project description

pybeerxml

A simple BeerXML parser for Python

CircleCI PyPi Version

Parses all recipes within a BeerXML file and returns Recipe objects containing all ingredients, style information and metadata. OG, FG, ABV and IBU are calculated from the ingredient list. (your milage may vary)

Installation

pip install pybeerxml

Usage

from pybeerxml import Parser

path_to_beerxml_file = "/tmp/SimcoeIPA.beerxml"

parser = Parser()
recipes = parser.parse(path_to_beerxml_file)

for recipe in recipes:

    # some general recipe properties
    print(recipe.name)
    print(recipe.brewer)

    # calculated properties
    print(recipe.og)
    print(recipe.fg)
    print(recipe.ibu)
    print(recipe.abv)

    # iterate over the ingredients
    for hop in recipe.hops:
        print(hop.name)

    for fermentable in recipe.fermentables:
        print(fermentable.name)

    for yeast in recipe.yeasts:
        print(yeast.name)

    for misc in recipe.miscs:
        print(misc.name)

Testing

Unit test can be run with PyTest:

python setup.py test

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pybeerxml, version 1.0.8
Filename, size File type Python version Upload date Hashes
Filename, size pybeerxml-1.0.8-py3-none-any.whl (8.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pybeerxml-1.0.8.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page