Skip to content

MukundaKatta/HealthLog

Repository files navigation

HealthLog

CI Python 3.10+ License: MIT Code style: black

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
Loading

Features

  • 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

Quickstart

Installation

pip install -e .

Usage

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")

Configuration

Copy .env.example to .env and adjust as needed:

cp .env.example .env

See docs/ARCHITECTURE.md for design details.

Development

make install    # install in dev mode
make test       # run tests
make lint       # run linter
make format     # auto-format code

Disclaimer

For 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.

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT © 2026 Officethree Technologies


Built by Officethree Technologies | Made with love and AI

About

Health metrics tracker — log weight, BP, heart rate, sleep with trend detection and goals (educational)

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors