A Python library for logging and analyzing personal health metrics with trend detection.
graph LR
A[User] -->|log_metric| B[HealthLog Core]
B -->|store| C[(SQLite DB)]
B -->|analyze| D[Trend Detection]
B -->|check| E[Range Validation]
B -->|export| F[CSV / JSON]
D --> G[Summary & Goals]
E --> G
- Log health metrics: weight, blood pressure, heart rate, sleep, and steps
- Query history with flexible date ranges
- Automatic trend detection (rising, falling, stable)
- Normal-range checking with medical-reference defaults
- Goal setting and progress tracking
- Export to CSV or JSON
- Lightweight SQLite storage — no server required
pip install -e .from healthlog import HealthLog
hl = HealthLog() # defaults to ~/.healthlog.db
# Log some metrics
hl.log_metric("weight", 74.5)
hl.log_metric("heart_rate", 68)
hl.log_metric("steps", 8500)
hl.log_metric("sleep", 7.5)
hl.log_metric("blood_pressure", 120, note="systolic")
# Analyze
avg = hl.get_average("heart_rate", days=30)
trend = hl.detect_trend("weight", days=90)
summary = hl.get_summary()
# Goals
hl.set_goal("steps", target=10000)
goal_status = hl.check_goals()
# Export
hl.export("json", filepath="my_health.json")Copy .env.example to .env and adjust as needed:
cp .env.example .envSee docs/ARCHITECTURE.md for design details.
make install # install in dev mode
make test # run tests
make lint # run linter
make format # auto-format codeFor educational purposes only. This library is not intended for medical diagnosis, treatment, or clinical decision-making. Always consult a qualified healthcare professional for medical advice.
Inspired by health tracking AI trends.
See CONTRIBUTING.md for guidelines.
MIT © 2026 Officethree Technologies
Built by Officethree Technologies | Made with love and AI