A BeerXML implementation for Python
Project description
pybeerxml
A simple BeerXML parser for Python
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
Full documentation is available at pybeerxml.onrender.com.
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 tests can be run with pytest:
uv run pytest
Contributing / Development
Community contributions are welcome.
Install uv, then sync dependencies:
uv sync
Make sure to test, lint, format, and type-check your code before sending a pull request:
uv run pytest
uv run ruff format .
uv run ruff check .
uv run ty check pybeerxml
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pybeerxml-2.2.0.tar.gz.
File metadata
- Download URL: pybeerxml-2.2.0.tar.gz
- Upload date:
- Size: 59.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55d3d941953610083f96ae2fd5c80ac6d41a0699e1804306049b0d4904caecff
|
|
| MD5 |
3fdf272bfc1a3643155c39f6880f9631
|
|
| BLAKE2b-256 |
b7ca4e57a081fe3a41788b423af3a0014272136e609155f50201e5f7b38e5728
|
Provenance
The following attestation bundles were made for pybeerxml-2.2.0.tar.gz:
Publisher:
publish_pypi.yml on hotzenklotz/pybeerxml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pybeerxml-2.2.0.tar.gz -
Subject digest:
55d3d941953610083f96ae2fd5c80ac6d41a0699e1804306049b0d4904caecff - Sigstore transparency entry: 1219332515
- Sigstore integration time:
-
Permalink:
hotzenklotz/pybeerxml@21065646a1a4c2a4d11fd5d515a9a66f07f162e3 -
Branch / Tag:
refs/tags/2.2.0 - Owner: https://github.com/hotzenklotz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@21065646a1a4c2a4d11fd5d515a9a66f07f162e3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pybeerxml-2.2.0-py3-none-any.whl.
File metadata
- Download URL: pybeerxml-2.2.0-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edd8b56c5695f4c9f10345563b26e8d90ad4127f29e69f8eeb2ac39375478c30
|
|
| MD5 |
c4e6d96e9f73ab0339f2b22f57d6cdbd
|
|
| BLAKE2b-256 |
cb6ebbd1643f5a593da13875fbbd24ebf06675a4837e2fa3ddcbf906b5ef97eb
|
Provenance
The following attestation bundles were made for pybeerxml-2.2.0-py3-none-any.whl:
Publisher:
publish_pypi.yml on hotzenklotz/pybeerxml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pybeerxml-2.2.0-py3-none-any.whl -
Subject digest:
edd8b56c5695f4c9f10345563b26e8d90ad4127f29e69f8eeb2ac39375478c30 - Sigstore transparency entry: 1219332522
- Sigstore integration time:
-
Permalink:
hotzenklotz/pybeerxml@21065646a1a4c2a4d11fd5d515a9a66f07f162e3 -
Branch / Tag:
refs/tags/2.2.0 - Owner: https://github.com/hotzenklotz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@21065646a1a4c2a4d11fd5d515a9a66f07f162e3 -
Trigger Event:
release
-
Statement type: