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:
objectParse and gives access to
Workoutdata 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.DataFrameaspd.SeriesReturns: New column for workflow DataFrameReturn 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.DataFrameReturns: 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:
objectParse 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
ActivitySummaryelements.Returns: of type ActivitySummaryorNoneif emptyReturn type: pd.DataFrame
-
extract_clinical_records() → pandas.core.frame.DataFrame[source]¶ Returns
ClinicalRecordelements.Returns: of type ClinicalRecordorNoneif emptyReturn type: pd.DataFrame
-
extract_correlations() → pandas.core.frame.DataFrame[source]¶ Returns
Correlationelements.Returns: of type CorrelationorNoneif emptyReturn type: pd.DataFrame
-
extract_me() → pandas.core.frame.DataFrame[source]¶ Returns
Meelements.Returns: of type MeorNoneif emptyReturn type: pd.DataFrame
-
extract_records() → pandas.core.frame.DataFrame[source]¶ Returns
Recordelements.Returns: of type RecordorNoneif emptyReturn type: pd.DataFrame