Skip to content

alexstelea/PyUp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PyUp PyUp

The most comprehensive Python Jawbone UP API wrapper.

Installation

Import the UPAPI class from the PyUp file

from PyUp import UpAPI

Initialize the UPAPI object to any variable

jawbone = UPAPI()

Usage

##Get Auth Code from Jawbone

Method to get the authentication code from Jawbone

jawbone.get_auth_code()

##Exchange Auth Code for Access Token

Method that exchanges a valid auth code for an access token

jawbone.exchange_code_for_token(code)

##Get Access Token

Return the access token for the user, if any.

This method is useful when retrieving the access token for all API calls.

jawbone.get_access_token()

##Band Events

###Get the band events Returns the band hardware events generated by the UP24 bluetooth connected band.

jawbone.get_band_events(access_token, date=None, start_time=None, end_time=None, created_after=None)

##Goals

###Get Goal

Returns the goals the user has set for UP. Currently takes no parameters and is read only.

jawbone.get_user_goals(access_token)

###Set Goal

Updates the user goal. Note your app must have the correct scope to update the respective goal.

jawbone.set_user_goal(access_token, move_steps=None, sleep_total=None, body_weight=None, body_weight_intent=None)

Heartrate

###Get resting heart rate for a user. Returns a single resting heart rate measurement captured at a specific, non-configurable time via an UP3 device.

jawbone.get_resting_heartrate(access_token, date=None, page_token=None, start_time=None, end_time=None, updated_after=None, limit=None):

##User

###Get basic information about the user Returns the basic information of the user

jawbone.get_user_details(access_token)

###Get list of friends

Returns the list of unique identifiers (XIDs) of the user's friends.

jawbone.get_friends_list(access_token)

##Workouts

###Get the user's workout list Returns the list of workouts of the current user.

jawbone.get_workouts_list(access_token, date=None, page_token=None, start_time=None, end_time=None, updated_after=None, limit=None)

###Get information about a specific workout Returns detailed information about the given workout.

get_workout_info(access_token, xid)

###Get the user's workout graphs Returns the image of the given workout.

get_workout_graph(access_token, xid)

###Get workout ticks Returns granular details for the specific Workout event.

get_workout_ticks(access_token, xid)

##Trends

###Get the user's trends Returns the user's trends over a period of time (e.g. 5 weeks), using the given granularity (e.g. by day).

get_trends(access_token, num_buckets, bucket_size=None, end_date=None):

##Moves

###Get the user's move list Returns the list of moves of the current user.

get_moves_list(access_token, date=None, start_time=None, end_time=None, updated_after=None, page_token=None) ###Get the information about a specific move

Returns the detailed information of the given move.

get_move_info(access_token, move_xid)

###Get the user's move graphs Returns the image of the given move.

get_move_graph(access_token, move_xid) ###Get move ticks Returns granular details for the specific Move event.

get_move_ticks(access_token, move_xid)

##Sleeps

###Get the user's sleep list

Returns the list of sleeps of the current user.

get_sleeps_list(access_token, date=None, start_time=None, end_time=None, updated_after=None, page_token=None)

##Generic API Call

A method used for any GET API call to any Jawbone endpoint

jawbone.get_generic_api_call(access_token, endpoint='/users/@me', **kwargs)

##Revoke Access Token

Disconnects user from application

jawbone.revoke_access_token(access_token)

Requirements

This wrapper only needs the following two requirements:

urllib and requests

About

The most comprehensive Python Jawbone UP API wrapper.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages