justinmklam / recipe-converter

Library and webapp to convert recipes from volumetric to weight measurements.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Metric Recipe Converter

Python application Build Status Coverage Status Documentation Status License: MIT

Web app to convert recipes from imperial volume to metric weight units.

Link to live project: recipe-converter-app.herokuapp.com

Features

  • Convert cups, tablespoons, and teaspoons of common ingredients to grams
  • Scale the recipe to any value
  • Option to load recipe from URL (if website is supported)
  • Reader view for distraction-free viewing (no ads or other fluff!)

Documentation is available on recipe-converter.readthedocs.io

Built With

Getting Started

General

To install the package:

pip install -e .

To run the web app:

cd app/
flask run

For Developers

To install dependencies:

pip install -r requirements-dev.txt
pip install -r docs/requirements.txt

To run development tasks:

# Run the tests
pytest tests/

# Build the docs
cd docs
make html

Usage

Example usage of the module is shown below.

import recipeconverter
rc = recipeconverter.RecipeConverter()

rc.convert_volume_to_mass("1 cup flour")
# 142 g flour

rc.convert_volume_to_mass("1 tsp sugar")
# 4.2 g sugar

recipe = """2/3 cup butter
1 cup sugar
3 bananas
1/2 teaspoon salt"""

rc.convert_recipe(recipe, multiplier=2.0)
# 302.7 g butter
# 396 g sugar
# 6 bananas
# 5 g salt

rc.convert_recipe_from_url("https://www.allrecipes.com/recipe/20144/banana-banana-bread/")
# 284 g all-purpose flour
# 6 g baking soda
# 1.2 g salt
# 113.5 g butter
# 148.5 g brown sugar
# 2 eggs, beaten
# 2.3 cup mashed overripe bananas

About

Library and webapp to convert recipes from volumetric to weight measurements.

License:MIT License


Languages

Language:Python 43.4%Language:HTML 27.4%Language:JavaScript 24.8%Language:CSS 4.4%