Skip to main content

The beerxml python package is a powerful tool designed to streamline the process of working with BeerXML files, ensuring that specific beer recipes adhere to the BeerXML standard. BeerXML is a widely adopted XML-based standard for representing brewing recipes, allowing brewers to share and exchange their recipes seamlessly.

Project description

Beerxml

Description

The beerxml python package is a powerful tool designed to streamline the process of working with BeerXML files, ensuring that specific beer recipes adhere to the BeerXML standard. BeerXML is a widely adopted XML-based standard for representing brewing recipes, allowing brewers to share and exchange their recipes seamlessly.

Installation

To install your package, use the following command:

pip install beerxml

Code Generation

The models in this beerxml package have been generated from this beerxml json schema with this command:

 datamodel-codegen  --input .\schemas\Recipe.json --input-file-type jsonschema --output output.py --snake-case-field --capitalise-enum-members --use-annotated  --use-non-positive-negative-numbe
r-constrained-types --output-model-type pydantic_v2.BaseModel

Usage

Import the BeerxmlParser class and inject the file content into the class like in the following example:

from beerxml import BeerxmlParser

# Example usage
parser: BeerxmlParser = BeerxmlParser()
with open("path/to/xml.file", "r") as file_content:
    recipe = parser.parse(file_content.read())

print(recipe.name)
print(recipe.hops)
print(recipe.fermentables)
print(recipe.yeasts)

Contributing

We welcome contributions from the community! If you would like to contribute to this project, please follow these guidelines:

Reporting Issues

If you encounter any issues or have suggestions, please open an issue on our GitHub repository.

Pull Requests

  1. Fork the repository and create a new branch for your contribution.
  2. Write clear and concise commit messages.
  3. Include unit tests for your changes
  4. Submit a pull request, clearly describing the changes you've made and providing any necessary context.

Linting and Code Style

We use the following linters to maintain code quality:

  • Ruff: for formatting.
  • Bandit: for security checks.
  • Mypy: for type checking.

Before submitting a pull request, ensure that your code passes these checks.

Unit Testing

All contributions must be accompanied by unit tests using pytest. Test coverage is crucial to ensure the reliability of the codebase.

To run tests locally:

pytest .

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

beerxml-0.0.4.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

beerxml-0.0.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file beerxml-0.0.4.tar.gz.

File metadata

  • Download URL: beerxml-0.0.4.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/6.2.0-1018-azure

File hashes

Hashes for beerxml-0.0.4.tar.gz
Algorithm Hash digest
SHA256 50dfb0775020e64f393f623a8861d2f9ac892c8d7532af84ffc5a8dd35f86c78
MD5 7f2440270ab341e32fc356a87d79a41f
BLAKE2b-256 1a77dc0fec70e4c7a5043bfd72a8f149aac41644f2fa1a6f1ea3ef39c7dc6744

See more details on using hashes here.

File details

Details for the file beerxml-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: beerxml-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/6.2.0-1018-azure

File hashes

Hashes for beerxml-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e18c1b12a054cc1c5d8e38318568a2d9eea3c7999a20abc7553ae2f761717d9c
MD5 0403be8e0932675b3e43074b9b706ac1
BLAKE2b-256 4417f9c590b509b6f7a23dea8e8b05f90f6851a00b70fdb03d8acbe8aa6dea01

See more details on using hashes here.

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