Help us understand the problem. What is going on with this article?

pythonのfitbitでsleepのstageを取得する

More than 1 year has passed since last update.

pip3 install fitbit

でいれたモジュールはAPIのバージョンが1だから、取れないっぽい。

https://github.com/orcasgit/python-fitbit/issues/128
とかをみると、1.2にすればいけるっぽい。

pipでいれたモジュールの調整がよくわからなかったので、直接書き換え。

homebrewでpython3を入れたosx(macos) Mojaveでの話

/usr/local/lib/python3.7/site-packages/fitbit/api.py

API_VERSION = 1

API_VERSION = 1.2

に書き換える。
2箇所あるよ。

これでfitbit.sleep(date=dtToday)すれば、minutesDataではなく、levelsが取れる。

nkmrtkhd
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away