Skip to main content

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

Project description

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"
}

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

parse-ingredients-0.0.4.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

parse_ingredients-0.0.4-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

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