health_tracking package¶
Submodules¶
health_tracking.constants module¶
health_tracking.workouts module¶
-
class
health_tracking.workouts.
Workouts
(zip_dump_path: str = '../data/raw/export.zip', unzip_path: str = '../data/interim/apple_health_export', force_unzip: bool = False)[source]¶ Bases:
object
Parse and gives access to
Workout
data of a Apple Health App dump data. Provides plotting functionalities.Parameters: - zip_dump_path (str, optional) – Path to the zipped data dump. Defaults to constants.ZIP_PATH.
- unzip_path (str, optional) – Path to the unzipped data dump. Defaults to constants.UNZIP_PATH.
- force_unzip (bool, optional) – Flag to force unzipping the data again. Can be useful for new data. Defaults to False.
-
health_tracking.workouts.
calc_minutes_per_km
(row: pandas.core.frame.DataFrame) → pandas.core.series.Series[source]¶ Helper function that calculates the pace as minutes per kilometer. Apply via:
data_frame.applyc(alc_minutes_per_km, axis=1)
.Parameters: row (pd.DataFrame) – Row of workouts pd.DataFrame
aspd.Series
Returns: New column for workflow DataFrame
Return type: pd.Series
-
health_tracking.workouts.
get_new_years_offsets
(workout_data_frame: pandas.core.frame.DataFrame) → list[source]¶ Helper function that computes the offsets for new years since the first workout, in days.
Parameters: workout_data_frame (pd.DataFrame) – Workouts pd.DataFrame
Returns: elements are the offsets for new years in days Return type: list
Module contents¶
-
class
health_tracking.
AppleHealthParser
(zip_dump_path: str = '../data/raw/export.zip', unzip_path: str = '../data/interim/apple_health_export', force_unzip: bool = False)[source]¶ Bases:
object
Parse and gives access to Apple Health App dump data.
Parameters: - zip_dump_path (str, optional) – Path to the zipped data dump. Defaults to constants.ZIP_PATH.
- unzip_path (str, optional) – Path to the unzipped data dump. Defaults to constants.UNZIP_PATH.
- force_unzip (bool, optional) – Flag to force unzipping the data again. Can be useful for new data. Defaults to False.
-
extract_activity_summaries
() → pandas.core.frame.DataFrame[source]¶ Returns
ActivitySummary
elements.Returns: of type ActivitySummary
orNone
if emptyReturn type: pd.DataFrame
-
extract_clinical_records
() → pandas.core.frame.DataFrame[source]¶ Returns
ClinicalRecord
elements.Returns: of type ClinicalRecord
orNone
if emptyReturn type: pd.DataFrame
-
extract_correlations
() → pandas.core.frame.DataFrame[source]¶ Returns
Correlation
elements.Returns: of type Correlation
orNone
if emptyReturn type: pd.DataFrame
-
extract_me
() → pandas.core.frame.DataFrame[source]¶ Returns
Me
elements.Returns: of type Me
orNone
if emptyReturn type: pd.DataFrame
-
extract_records
() → pandas.core.frame.DataFrame[source]¶ Returns
Record
elements.Returns: of type Record
orNone
if emptyReturn type: pd.DataFrame