Skip to content

justinmklam/recipe-converter

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published