coddingtonbear / python-myfitnesspal

Access your meal tracking data stored in MyFitnessPal programatically
MIT License
800 stars 138 forks source link

Adding methods for extracting exercise data #50

Closed samhinshaw closed 7 years ago

samhinshaw commented 7 years ago

This is based off the proposed changes in PR #43 I'm new to python development (I mostly use R & JS), so there may be some best practices not observed and methods I could have implemented better:

coddingtonbear commented 7 years ago

Awesome -- thanks for the contribution, @samhinshaw! I think this'll be very useful for people, and am glad you posted a pull request adding this!

The only thing I'd recommend doing -- if you could find the time -- is adding a test case. It's not super complicated, and I'm definitely going to merge your changes without the test case, but I'd really appreciate it if you could add one when you find the time.

Briefly, the way our test cases work is that you save an anonymized (remove anything private-looking from the HTML) copy of the HTML page you're scraping for gathering exercise data to the tests/html folder, and create a test method that validates that the data you expect is returned when parsing your sample document. Test cases like that are invaluable for identifying what has changed when MyFitnessPal changes their UI.

Incidentally -- your python is perfect :heart:.

samhinshaw commented 7 years ago

Thank you! 😊 I'm glad I could help, and I hope people do find this useful. I will check out the existing test cases and add some tests for the new methods!