Already tracking somewhere else? These scripts bring it in. Each one takes --dry-run, so you can see what it would do before it writes anything. Run them from the sardinetracker folder with your virtual environment active (see the README).
From Apple Health
Sardinetracker can import HRV, sleep hours, wrist temperature, and daylight exposure from Apple Health, or whatever else you are tracking. Which provides free-of-cost raw data downloads.
Export from Apple Health:
- Open the Health app on your iPhone
- Tap your profile picture in the top right
- Scroll down and tap Export All Health Data
- AirDrop the export to your Mac, or save to Files and transfer via iCloud
- The file is going to be huge, just a warning.
Recommended: Use the Health Export app (free tier is fine)
- Download Health Export from the App Store
- Select: Heart Rate Variability, Sleep Analysis, Apple Sleeping Wrist Temperature, Time in Daylight
- Set your date range, export as CSV daily average
- Transfer the CSV to your computer
- Also download Menstrual Cycle data if you're using cycle tracking — see below.
Import:
python import_apple_health.py path/to/your_export.csv
# Preview without writing:
python import_apple_health.py ~/Downloads/health_export.csv --dry-run
# Create new rows for dates that don't exist yet:
python import_apple_health.py ~/Downloads/health_export.csv --create-new
From Apple Health — Menstrual Cycle Data
If you enabled cycle tracking during setup, import your cycle history from an Apple Health XML export:
- Export from Health app (see above)
- Use the Health Export app — select Menstrual Flow and Intermenstrual Bleeding, export as CSV
- Import:
# Preview first:
python import_cycle.py --csv your_cycle_export.csv --dry-run
# Import:
python import_cycle.py --csv your_cycle_export.csv
Flow priority when multiple records exist for the same day: heavy > medium > light > spotting. Intermenstrual Bleeding is imported as spotting. Sexual Activity and Persistent Menstrual Bleeding records are skipped.
From Your Own Symptom Tracker
If you've been tracking in a spreadsheet, you can import it. Required column: Date (in YYYY-MM-DD, MM/DD/YYYY, or "Jul 22, 2025" format). Optional columns are mapped automatically for symptom flags, pain/fatigue scales, sleep hours, and notes.
python import_tracker.py path/to/your_tracker.csv --dry-run
python import_tracker.py path/to/your_tracker.csv
Lab Results
Date,Test,Value,Units,Lab,Doctor
2021-04-16,C4,28,mg/dL,LabCorp,Dr. Smith
python import_labs.py path/to/labs.csv --dry-run
python import_labs.py path/to/labs.csv
The script auto-detects reference ranges and flags common tests (C3, C4, CRP, ESR, anti-dsDNA, etc.).
UV Data Backfill
After importing historical data, fetch UV values for those dates:
python backfill_uv.py
You'll need a free Visual Crossing API key. Add it to config.json:
"visual_crossing_key": "YOUR_KEY_HERE"
The free tier allows 1000 records/day. Historical UV uses ~24 records per day, so you can backfill about 40 days for free. Beyond that, the metered plan is $0.0001/record.