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.
Metadata
Release files for apple-health 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| apple-health-2.0.0.tar.gz | 10.1 kB | Without provenance | Details for apple-health-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| apple_health-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for apple_health-2.0.0-py3-none-any.whl |
Total release size: 22.9 kB
Release files / apple-health-2.0.0.tar.gz
| Download URL | apple-health-2.0.0.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65385f62634d2357732ccdb52adb3633642295580147a5864732dd7e51aecc01
|
|
BLAKE2b-256 checksum How to use checksums |
48daa14dc76f7f657bf9ad5bf4f6d5b144821a5feb7ffef805a1abee62e05653
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.8.13 Linux/5.13.0-1031-azure
|
Release files / apple_health-2.0.0-py3-none-any.whl
| Download URL | apple_health-2.0.0-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
94ac27614f0dbe66b012d9fa37f535c6ed5968012ef3256d3dcbcd66f21d259d
|
|
BLAKE2b-256 checksum How to use checksums |
b8179e966f7c7cdfe526871c337edca054906c04760c0c475e7d97607ca383e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.8.13 Linux/5.13.0-1031-azure
|
Security for apple-health 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.