Skip to main content

A Python package for parsing Apple Health Export data

Project description

Apple Health Parser

https://pypi.org/project/parse-apple-health-data/0.0.1/

A Python package for parsing and analyzing Apple Health Export data.

Installation

pip install parse-apple-health-data

Usage

from parse_apple_health_data import load_health_data

# Create parser instance
parser = load_health_data('export.xml')

# Get data as pandas DataFrames
dataframes = parser.to_dataframes()

# Physical Measurements:
height_df = dataframes['HKQuantityTypeIdentifierHeight']
body_mass_df = dataframes['HKQuantityTypeIdentifierBodyMass']

# Activity Tracking:
steps_df = dataframes['HKQuantityTypeIdentifierStepCount']
distance_walking_running_df = dataframes['HKQuantityTypeIdentifierDistanceWalkingRunning']
flights_climbed_df = dataframes['HKQuantityTypeIdentifierFlightsClimbed']

# Energy Expenditure:
basal_energy_burned_df = dataframes['HKQuantityTypeIdentifierBasalEnergyBurned']
active_energy_burned_df = dataframes['HKQuantityTypeIdentifierActiveEnergyBurned']

# Audio Exposure:
headphone_audio_exposure_df = dataframes['HKQuantityTypeIdentifierHeadphoneAudioExposure']
audio_exposure_event_df = dataframes['HKCategoryTypeIdentifierHeadphoneAudioExposureEvent']

# Walking Metrics:
walking_double_support_percentage_df = dataframes['HKQuantityTypeIdentifierWalkingDoubleSupportPercentage']
walking_speed_df = dataframes['HKQuantityTypeIdentifierWalkingSpeed']
walking_step_length_df = dataframes['HKQuantityTypeIdentifierWalkingStepLength']
walking_asymmetry_percentage_df = dataframes['HKQuantityTypeIdentifierWalkingAsymmetryPercentage']
walking_steadiness_df = dataframes['HKQuantityTypeIdentifierAppleWalkingSteadiness']

# Sleep Metrics:
sleep_analysis_df = dataframes['HKCategoryTypeIdentifierSleepAnalysis']
sleep_duration_goal_df = dataframes['HKDataTypeSleepDurationGoal']

Features

  • Parse Apple Health Export XML files
  • Convert health data to pandas DataFrames
  • Separate handling for quantity and category measurements
  • Preserve all metadata from original export
  • Type hints and documentation

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parse_apple_health_data-0.0.1.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file parse_apple_health_data-0.0.1.tar.gz.

File metadata

  • Download URL: parse_apple_health_data-0.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for parse_apple_health_data-0.0.1.tar.gz
Algorithm Hash digest
SHA256 829515cec9992a30b60604e2c9ca572a67b8d9391ae4805788b2559b95027169
MD5 381582175cc6bda5035b05a10b1f4d3c
BLAKE2b-256 c4acc45c6ad2e06a1964396fd735b96bcf6bb2af17ee231851eb68ee32b08df5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page