Fitbit/python-fitbit

From Omnia
Jump to navigation Jump to search

python-fitbit

Fitbit API Wrapper - Fitbit API Python Client Implementation

PIP: https://pypi.python.org/pypi/fitbit

GitHub: https://github.com/orcasgit/python-fitbit

Documentation: http://python-fitbit.readthedocs.org/

API: https://wiki.fitbit.com/display/API/V1

Installation

pip install fitbit

Examples

Documentation example:

import fitbit

consumer_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

target_user_id='xxxxxx'

# Unauthorized Client
unauth_client = fitbit.Fitbit(consumer_key, consumer_secret)
print client.user_profile_get(user_id=target_user_id)
print client.get_friends(user_id=target_user_id)
  1. You'll have to gather the user keys on your own, or try ./fitbit/gather_keys_cli.py <con_key> <con_sec> for development

authd_client = fitbit.Fitbit('<consumer_key>', '<consumer_secret>', resource_owner_key='<user_key>', resource_owner_secret='<user_secret>') authd_client.sleep()