Skip to content

Parse strings of ingredients to their name, unit, quantity and optional comments

License

Notifications You must be signed in to change notification settings

MichielMag/parse-ingredients

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-ingredients

Parse strings of ingredients to their name, unit, quantity and optional comments.

To install

pip install parse-ingredients

To use

from parse_ingredients import parse_ingredient

result = parse_ingredient("12 ounces lean ground beef, preferably 85 percent lean")
print(f"Found results: \n {result}")

parse_ingredient() returns an object in the form of:

{
    "name": "lean ground beef",
    "quantity": 12,
    "unit": "oz",
    "comment": "preferably 85 percent lean",
    "original_string": "12 ounces lean ground beef, preferably 85 percent lean"
}

About

Parse strings of ingredients to their name, unit, quantity and optional comments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages