by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 29 20:32

    coddingtonbear on master

    Rename 'Weight' to 'Mass'. I k… Merge pull request #98 from hil… (compare)

  • May 29 20:32
    coddingtonbear closed #98
  • May 29 20:28
    hillwithsmallfields opened #98
  • May 29 19:30
    hillwithsmallfields commented #97
  • May 29 19:19
    coddingtonbear labeled #97
  • May 29 19:19
    coddingtonbear labeled #97
  • May 29 19:18
    coddingtonbear commented #97
  • May 29 19:14
    hillwithsmallfields opened #97
  • May 27 17:13
    sarahnator closed #96
  • May 27 17:13
    sarahnator commented #96
  • May 23 22:30

    coddingtonbear on master

    Bump version: 1.13.4 → 1.14.0 (compare)

  • May 23 22:30

    coddingtonbear on 1.14.0

    (compare)

  • May 23 22:29
    coddingtonbear commented #89
  • May 23 22:29

    coddingtonbear on master

    switch to the measurements/new … whitespace fixing builds in 2.7 - see http… and 3 more (compare)

  • May 23 22:29
    coddingtonbear closed #89
  • May 23 22:27

    coddingtonbear on master

    update keyring requirement Merge pull request #92 from hbm… (compare)

  • May 23 22:27
    coddingtonbear closed #92
  • May 21 23:06
    mtthwsar commented #96
  • May 21 23:05
    mtthwsar commented #96
  • May 21 23:05
    mtthwsar commented #96
David Lerner
@dmlerner
@pythondude0 I have it working with the windows linux subsystem, highly reccomend for all things programming on windows
Is it possible to upload to my myfitnesspal account? I'd love to be able to add entires via my own CLI and sync/upload them to my account
David Lerner
@dmlerner
I see this was discussion june of 2017, but maybe there's been a development? https://developer.underarmour.com/docs-mpf/diary-post/ seems to have the specification
Adam Coddington
@coddingtonbear
Unfortunately, you can't get an API key unless you're a "partner" of theirs, @dmlerner -- https://www.myfitnesspal.com/api , so their API docs are no indication of what can be accomplished
AnonJohn
@AnonJohn
Hi - Here is an approach that lets you scrape ALL nutrient data from the MFP website: https://josetorres.us/data-science/scraping-myfitnesspal-with-python/
The key is that each nutrient has a convenient, parsable website associated with it. e.g.: https://www.myfitnesspal.com/reports/results/nutrition/Fiber/1 .... the one at the end refers to the number of days. Hope this is useful to someone!
uccollab
@uccollab
Hi guys. Is there a way to obtain goals in terms of calories, protein etc..?
@coddingtonbear
Adam Coddington
@coddingtonbear
I’m only directly aware of nutrition information exposed by the library, but if goals were added, they’d be in the documentation, @uccollab
uccollab
@uccollab
Could you point me at the doc? Cause I'm unable to find it, I've only found the readme of the git repo
uccollab
@uccollab
@coddingtonbear sorry, forgot to tag
Adam Coddington
@coddingtonbear
it is linked from the project readme on gothub, @uccollab
uccollab
@uccollab
@coddingtonbear Sorry but are you sure? 99% it is my fault, but I'm unable to find it from the readme..
Adam Coddington
@coddingtonbear
actually; that readme is this project’s documentation
uccollab
@uccollab
@coddingtonbear oh ok, that explains everything.

Ok I got it guys. I will write it just in case anyone ends up in this gitter for the same:

In order to obtain the goals you just have to retrieve any day worth of data with something like:
day = client.get_date(2019, 11, 23)
Then you can just get the goals via:
day.goals

uccollab
@uccollab
@coddingtonbear just a quick suggestion: you guys should write a proper documentation because lots of methods and parameters of this library are not explained. Nevertheless thank you for your great work.
Adam Coddington
@coddingtonbear
This is a project run by volunteers, @uccollab; if you'd like to write some proper documentation covering things, we'd love to accept your pull request.
uccollab
@uccollab
@coddingtonbear ty but I didn't write the API, and testing it until I covered every possible use would be a bit exhausting haha
Adam Coddington
@coddingtonbear
That's roughly the situation we're all in! Generally, we require that submitted features have at least basic documentation, but it's a little difficult to justify setting a high bar for documentation when folks are working for free to build a tool that might be useful to people like us.
David-Wales
@David-Wales
Hey, this is an awesome library thank you so much for your work on it.
I'm currently playing around with using it to add food entries
I'm not however a web developer and I think i'm making some stupid mistakes re HTTP requests
so it seems that the /food/add url is the following
Some example params are
Form data:
food_entry[food_id]: 917964335
food_entry[date]: 2020-02-05
food_entry[quantity]: 1.0
food_entry[weight_id]: 1128024684
food_entry[meal_id]: 1
ajax: true
I'm doing something like this
data = {'food_entry[food_id]': 917964335,'food_entry[date]' : '2020-02-05', 'food_entry[quantity]' : 1.0, 'food_entry[weight_id]' : 1128024684, 'food_entry[meal_id]' : 1, 'ajax' : 'true'}
res = client.session.post('https://www.myfitnesspal.com/food/add/', data=data)
I was following how posts are made to add weight
I also tried adding the following
data['authenticity_token'] = client._authenticity_token
Am I doing something stupid here
Not a python or a web developer but if I can get this working I'm happy to contribute back
Once again thanks for all the good work!
David-Wales
@David-Wales
forgot to tag @coddingtonbear
Adam Coddington
@coddingtonbear
I'm afraid it's super hard to know given that there isn't a documented API to interact with, @David-Wales ; it's likely going to take some trial-and-error to reverse engineer interactions with that particular feature.
Adam Coddington
@coddingtonbear
but if you posted more information about what exactly went wrong, somebody might have ideas
glarnonym
@glarnonym
Hi! I'm wondering if there is a way to pull the 'Fitbit body fat %' measurement from myfitnesspal? Your wiki states "The first argument specifies the measurement name, which can be any name listed in the MyFitnessPal Check-In page" but "client.get_measurements('Fitbit body fat %')" won't work, since the measurement does not exist.
Derek
@datavistics
Is it possible to use this for adding data? Id like to add my weight programatically.
Derek
@datavistics
@coddingtonbear

Is it possible to use this for adding data? Id like to add my weight programatically.

In case Im a little unclear: My goal would be to submit data using python. Syncing would be one big benefit.

Liam Gower
@leej11
Hey just discovered this package and wondering if it's possible to post nutrition/meal activity to myfitnesspal using the API ? I searched this chat history but doesn't turn up much! Thanks in advance!
Adam Coddington
@coddingtonbear
if you don't see it in the readme, I'm afraid it's likely it doesn't exist @datavistics & @leej11
ironlion27
@ironlion27
~$ myfitnesspal store-password ironlion27
Traceback (most recent call last):
File "/home/nerio/.local/bin/myfitnesspal", line 7, in <module>
from myfitnesspal.cmdline import main
File "/home/nerio/.local/lib/python2.7/site-packages/myfitnesspal/init.py", line 1, in <module>
from myfitnesspal.client import Client # noqa
File "/home/nerio/.local/lib/python2.7/site-packages/myfitnesspal/client.py", line 7, in <module>
from measurement.measures import Energy, Weight, Volume
File "/home/nerio/.local/lib/python2.7/site-packages/measurement/measures/init.py", line 1, in <module>
from measurement.measures.distance import
File "/home/nerio/.local/lib/python2.7/site-packages/measurement/measures/distance.py", line 147
*
{
^
not sure where to go from here
rous100
@rous100
does this work to access a friend's diary?
uccollab
@uccollab
@coddingtonbear hi dude, one quick question. Do you have any concern wether scraping user data with your API for an academic experiment is legal or not?
Adam Coddington
@coddingtonbear
I'm not a lawyer, @uccollab; I'd recommend reaching out to one in any case when you are concerned you might be violating a company's terms of use.
@ironlion27 -- this library requires Python 3+; you appear to be using python 2.7