coddingtonbear / python-myfitnesspal

Access your meal tracking data stored in MyFitnessPal programatically

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError 'fiber' for get_date -> _get_meals -> _get_measurement when unit aware is true

kb1900 opened this issue · comments

`
KeyError: 'fiber'

data = client.get_date(start_date)
File "myfitnesspal/client.py", line 452, in get_date
meals = self._get_meals(document)
File "myfitnesspal/client.py", line 319, in _get_meals
nutrition[nutr_name] = self._get_measurement(nutr_name, value)
File "myfitnesspal/client.py", line 218, in _get_measurement
measure, kwarg = self.DEFAULT_MEASURE_AND_UNIT[name]`

I'd like using measurement objects for my data but am not able to load certain logs with unit_aware set to True due to the keyerror.

i think this would be an easy fix to just add the key value pair "fiber": Mass(g=0), to DEFAULT_MEASURE_AND_UNIT