GithubHelp home page GithubHelp logo

openhumans / oh-fitbit-integration Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 6.0 390 KB

Integration for connecting & importing Fitbit data into the Open Humans platform

Home Page: https://fitbit.openhumans.org

Python 87.27% CSS 0.07% JavaScript 0.03% HTML 12.63%

oh-fitbit-integration's People

Contributors

gedankenstuecke avatar madprime avatar mcescalante avatar mldulaney avatar treblesteph avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

oh-fitbit-integration's Issues

Fetch "activity types" data for speed data for activities

There were discussions of getting walking speed data into OH and after looking at the Fitbit API it looks like there are 2 different API endpoints that aren't being utilized that contain activity speed information:

  1. "Activities list" which contains a single speed datapoint for an entire activity
  2. "Activity type" which returns more detailed information about an activity including min & max speed per "level" https://dev.fitbit.com/build/reference/web-api/activity/#get-activity-type

We should add in the latter to our fetching to see how much data accumulates for someone who has years worth of activity data.

Updates to Fitbit's API endpoints for sleep?

Looking at this:
https://github.com/OpenHumans/oh-fitbit-integration/blob/master/datauploader/tasks.py

... it seems that the endpoint is going to https://api.fitbit.com/1/user

That prefix is still used for the following:

  • Activity endpoints which have the a format https://api.fitbit.com/1/user/[user-id]/activities/tracker/...
  • Heart endpoints which have the a format https://api.fitbit.com/1/user/[user-id]/activities/heart/...
  • Body & weight endpoints which have the a format https://api.fitbit.com/1/user/[user-id]/activities/body/...

However from the sleep documentation: https://dev.fitbit.com/build/reference/web-api/sleep/

... I see the endpoint seems to be updated to be like https://api.fitbit.com/1.2/user/-/sleep/. (Note the "1.2".)

I was looking into this because I'd like to be collecting the sleep stages data (minute-by-minute information about which "stage" of sleep is occurring), which appears to be available in this new endpoint. (I think the old one is working but deprecated: https://dev.fitbit.com/build/reference/web-api/sleep-v1/ )

Data imports ignore new data of same year

Currently our data import task (https://github.com/OpenHumans/oh-fitbit-integration/blob/master/datauploader/tasks.py) uses only the presence of a given key to determine whether we already have the corresponding data or not.

This is problematic as a given year is the top-level key in our JSON. So e.g. once we have fetched any data for 2018 we will ignore all new data and not import further data. This needs to be fixed by checking whether the data for a given key is complete and re-running the import for that key if its not.

See my public fitbit data at https://www.openhumans.org/member/gedankenstuecke for an example of this behaviour.

Block update task

Right now you can push the update data button as many times as you want and I think it'll also trigger that update as often as you push the button?

Would be good if we could fully implement the cool down (through last_submitted as for moves)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.