bhf_smarthealth.process.healthapp_process

bhf_smarthealth.process.healthapp_process#

This module utilises functions from the parse.healthapp_parser module to batch process raw Health App metrics data

Attributes#

Functions#

process_file(→ dict[str, pandas.DataFrame])

Process an individual raw Health App .json file

process_day(in_dir, out_paths, date_str)

Process a daily batch of raw healthapp .json files

Module Contents#

bhf_smarthealth.process.healthapp_process.logger#
bhf_smarthealth.process.healthapp_process.process_file(part_path: pathlib.Path) → dict[str, pandas.DataFrame][source]#

Process an individual raw Health App .json file

Parameters:

part_path (Path) – Path to subdirectory containing raw Health App .json file to be processed

Returns:

Dictionary containing “workouts” and “metrics” DataFrames

Return type:

dict[str, DataFrame]

Raises:

FileNotFoundError – Raised if a healthapp/*_healthdata.json file cannot be located in this subdirectory

bhf_smarthealth.process.healthapp_process.process_day(in_dir: pathlib.Path, out_paths: dict[str, pathlib.Path], date_str: str)[source]#

Process a daily batch of raw healthapp .json files

Parameters:
  • in_dir (Path) – Path of the directory containing raw data to batch process

  • out_paths (Path) – Dictionary containing Paths to output the merged “workouts” and “metrics” DataFrames to

  • date_str – String of date being processed