Workout With Friends Stay fit with a little motivation

- Main Page
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

All Classes Namespaces Files Functions Variables Properties
Classes | Functions | Variables
wowf.lib.utils Namespace Reference

## Classes
class | Storage
| Generic container class. More...

## Functions
def | parse_workout_report
| Parse and extract the needed data from the csv of the workout report.
def | calculate_wilks_coefficient
| Calculate the wilkes coefficient for this user.
def | calculate_one_rep_max
| Calculate the estimated one rep max.
def | calculate_bmi
| Calculate a persons body mass index, given weight (kg) and height (m).
def | years_ago
| Calculate the difference in years between the start date and today.
def | get_subclasses
| Get all classes residing in a given module which subclass a given base class.
def | split_cslist
| Split a comma separated list by both newlines and commas.
def | current_timestamp
def | to_user_timezone
| Convert a datetime from system timezone to the given timezone.
def | to_system_timezone
| Convert a datetime from the given timezone to system timezone.
def | parse_timedelta
| Get the days, hours, and minutes from a timedelta object.
def | settings_from_prefix
| Return a dictionary of settings all containing the same key prefix, with the prefix removed from the keys.

## Variables
string | TIMESTAMP = 'timestamp_epoch'
string | DISTANCE = 'DISTANCE'
string | HEARTRATE = 'HEARTRATE'
string | CALORIEBURN = 'CALORIEBURN'

## Function Documentation

def wowf.lib.utils.calculate_bmi | ( |  | weight,
|  |  | height
| ) |  |

Calculate a persons body mass index, given weight (kg) and height (m).

Definition at line 89 of file utils.py.

def wowf.lib.utils.calculate_one_rep_max | ( |  | weight,
|  |  | repetitions
| ) |  |

Calculate the estimated one rep max.

Parameters

  weight | How much weight the user lifted.
  repetitions | How many times the user lifted the weight.

Definition at line 79 of file utils.py.

def wowf.lib.utils.calculate_wilks_coefficient | ( |  | weight,
|  |  | gender
| ) |  |

Calculate the wilkes coefficient for this user.

Parameters

  weight | The users weight (kg).

Definition at line 53 of file utils.py.

def wowf.lib.utils.current_timestamp | ( |  | ) |

Definition at line 143 of file utils.py.

def wowf.lib.utils.get_subclasses | ( |  | module,
|  |  | base,
|  |  | with_base = `False`
| ) |  |

Get all classes residing in a given module which subclass a given base class.

Parameters

  with_base | Whether to include the base class also

Definition at line 121 of file utils.py.

def wowf.lib.utils.parse_timedelta | ( |  | td | ) |

Get the days, hours, and minutes from a timedelta object.

Definition at line 171 of file utils.py.

def wowf.lib.utils.parse_workout_report | ( |  | workout_report | ) |

Parse and extract the needed data from the csv of the workout report.

Definition at line 23 of file utils.py.

def wowf.lib.utils.settings_from_prefix | ( |  | settings,
|  |  | prefix
| ) |  |

Return a dictionary of settings all containing the same key prefix, with the prefix removed from the keys.

Definition at line 181 of file utils.py.

def wowf.lib.utils.split_cslist | ( |  | cslist | ) |

Split a comma separated list by both newlines and commas.

Definition at line 135 of file utils.py.

def wowf.lib.utils.to_system_timezone | ( |  | dt,
|  |  | timezone
| ) |  |

Convert a datetime from the given timezone to system timezone.

Definition at line 161 of file utils.py.

def wowf.lib.utils.to_user_timezone | ( |  | dt,
|  |  | timezone
| ) |  |

Convert a datetime from system timezone to the given timezone.

Definition at line 151 of file utils.py.

def wowf.lib.utils.years_ago | ( |  | start_dt | ) |

Calculate the difference in years between the start date and today.

Definition at line 100 of file utils.py.

## Variable Documentation

string wowf.lib.utils.CALORIEBURN = 'CALORIEBURN'

Definition at line 16 of file utils.py.

string wowf.lib.utils.DISTANCE = 'DISTANCE'

Definition at line 14 of file utils.py.

string wowf.lib.utils.HEARTRATE = 'HEARTRATE'

Definition at line 15 of file utils.py.

string wowf.lib.utils.TIMESTAMP = 'timestamp_epoch'

Definition at line 13 of file utils.py.