Unit Helper

Helpers for converting Strava’s units to something more practical.

These are really just thin wrappers to the brilliant ‘units’ python library.

stravalib.unithelper.c2f(celsius)[source]

Convert Celsius to Fahrenheit.

celsius :

Temperature in Celsius.

float

Temperature in Fahrenheit.

stravalib.unithelper.timedelta_to_seconds(td)[source]

Converts a timedelta to total seconds, including support for microseconds.

Return value is (potentially truncated) integer.

(This is built-in in Python >= 2.7, but we are still supporting Python 2.6 here.)

tddatetime.timedelta

The timedelta object

int

The number of total seconds in the timedelta object.