Skip to main content

PyBeerYAML A YAML format parser for beer storage

Project description

version license drone

A YAML format parser for beer storage

Parse a recipe from a YAML file and returns an object containing ingredients and metadata. Supports export to beerxml format.

Installation

pip install pybeeryaml

Usage

from pybeeryaml import Recipe

path_to_beeryaml_file = "/tmp/my_recipe.yml"

# create recipe from file
recipe = Recipe.from_file(path_to_beeryaml_file)

# or from string
with open(path_to_beeryaml_file, "r") as mybeer:
    recipe2 = Recipe.from_yaml(mybeer.read())

assert recipe == recipe2  # True

# convert to beerxml format
recipexml = recipe.to_xml()

Testing

Unit tests can be run with pytest.

py.test tests

Project details


Download files

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

Source Distribution

pybeeryaml-1.3.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

pybeeryaml-1.3-py2.py3-none-any.whl (23.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page