strava_api module#

strava_api.authenticate()#

Retrieves Authorization token for Strava API.

Parameters:

None

Returns:

access token required to make calls

with the Strava API

Return type:

strava_authorization

strava_api.connect_to_urllib()#

Creates a Pool Manager instance to allow requests to be made. “This object handles all of the details of connection pooling and thread safety so that you don’t have to”

Parameters:

None

Returns:

an instance of urllib3 Pool Manager

Return type:

http

strava_api.generate_new_token(http)#

Generates a new access token for the Strava API. This will be saved as an enviromental variable.

Parameters:

http – an instance of urllib3 Pool Manager

Returns:

Nothing

strava_api.get_activities(http)#

Displays a list of the current authorized user’s activities.

Parameters:

http – an instance of urllib3 Pool Manager

Returns:

a json holding all

public user activities

Return type:

activity_data

strava_api.get_athlete(http)#

Displays data of the current authorized user.

Parameters:

http – an instance of urllib3 Pool Manager

Returns:

a dictionary (json) holding data

regarding the current Strava user

Return type:

athlete_data

strava_api.get_zones(http, activity_id)#

For premium Strava users only. Returns a list of zones for a specific activity

Parameters:
  • http – an instance of urllib3 Pool Manager

  • activity_id – the id of activity to determine training zone

Returns:

a json holding training zones for a specific activity

Return type:

zone_data

strava_api.need_new_token(http)#

Determines if a new access token needs to be generated. Through the Strava API, access keys expire every 6 hours.

Parameters:

http – an instance of urllib3 Pool Manager

Returns:

returns boolean value for if a new token

must be generated

Return type:

boolean