simon-andrews / umass-toolkit

Tools for accessing and using data from the University of Massachusetts Amherst. Unofficial.
https://umass-toolkit.readthedocs.io/en/latest/
MIT License
11 stars 6 forks source link

Flatten menu response and refactor menu functions #20

Closed mattrossman closed 6 years ago

mattrossman commented 6 years ago

Moved the HTML parsing function into the utility module since users won't be calling it. When an attribute has an empty value (e.g. '') the returned dish will hold the attribute with a None value instead of ignoring the attribute. Resolves #19

mattrossman commented 6 years ago

I used attribute names dish-name, meal-name, and category-name for consistency because data-dish-name is the original dish attribute name, menu_category_name is the original category attribute name, and most of are other properties are named as the original minus the prefix.

If needed these could be shortened as dish, meal, and category.

simon-andrews commented 6 years ago

Looks good! Unfortunately, Berk is the only DC open today and they don't seem to be serving up a menu right now (the UMass Dining app can't find anything either) so this code can't really be checked. For now, let's just merge and make sure to check up on it again later.