Library to extract information from Apple Health exports.
Project description
apple-health
Library to extract information from Apple Health exports.
Setup
To use this library, is required to provide an export file from the iOS Apple Health app.
How to get the export
- Open the Apple Health app on your iOS device.
- Tap on your profile picture on the top-right corner.
- Scroll down until you see a button that reads "Export All Health Data".
- After pressing the button, a dialog will appear while the export process is ongoing (it might take a while).
- Once the process is finished, a file called
apple_health_export.zipwill be generated. - Finally, from that zip file you'll need only the file named
export.xml.
Usage
from health import HealthData
FILE = "./export/export.xml"
data = HealthData.read(
FILE,
include_me=True,
include_activity_summaries=True,
include_correlations=False,
include_records=False,
include_workouts=True,
)
print(data.me.biological_sex)
print(f"{len(data.activity_summaries)} activity records")
print(f"{len(data.correlations)} correlations")
print(f"{len(data.records)} records")
print(f"{len(data.workouts)} workouts")
>> HKBiologicalSexMale
>> 322 activity records
>> 0 correlations
>> 0 records
>> 129 workouts
note: use the flags on the
HealthData.readto include only what you need to speed up the reading process.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apple-health-2.0.0.tar.gz.
File metadata
- Download URL: apple-health-2.0.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0 CPython/3.8.13 Linux/5.13.0-1031-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65385f62634d2357732ccdb52adb3633642295580147a5864732dd7e51aecc01
|
|
| MD5 |
a167d5077e7d228edd8fa9eb2deaf8e8
|
|
| BLAKE2b-256 |
48daa14dc76f7f657bf9ad5bf4f6d5b144821a5feb7ffef805a1abee62e05653
|
File details
Details for the file apple_health-2.0.0-py3-none-any.whl.
File metadata
- Download URL: apple_health-2.0.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0 CPython/3.8.13 Linux/5.13.0-1031-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94ac27614f0dbe66b012d9fa37f535c6ed5968012ef3256d3dcbcd66f21d259d
|
|
| MD5 |
48e6a38551c1c2186d63f2b134b54c45
|
|
| BLAKE2b-256 |
b8179e966f7c7cdfe526871c337edca054906c04760c0c475e7d97607ca383e9
|