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/1.0.0/

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-1.0.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parse_apple_health_data-1.0.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parse_apple_health_data-1.0.0.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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f2e530e806f4eef0ac1ffd915020358d2664a6442e4bb7ba5f9ead8092b2e898
MD5 cc537a043aead843663df26eb691b19f
BLAKE2b-256 73862a826542760ed2d292cb125e8e795d9738902b68d176590298f60d21d1a6

See more details on using hashes here.

File details

Details for the file parse_apple_health_data-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for parse_apple_health_data-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02d3dd203419e75b77ae0e1a770a249892fae855b14a7acc35a4eba998d7d334
MD5 6c94b72dcf61ef1036d62de65ca26bd5
BLAKE2b-256 41c4299ab6c3f99bdc97fafbbd0b1432f122a50eb9e203b68596a1362318b6f3

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