From 7e584586bb8a04dd10a60e3595c4f507718ed6e7 Mon Sep 17 00:00:00 2001 From: Madeline Cameron Date: Tue, 6 Apr 2021 19:43:34 -0400 Subject: [PATCH] new: levels health --- my/levelshealth.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 my/levelshealth.py diff --git a/my/levelshealth.py b/my/levelshealth.py new file mode 100644 index 0000000..c53cf15 --- /dev/null +++ b/my/levelshealth.py @@ -0,0 +1,41 @@ +''' +Levels Health data +''' + +REQUIRES = [ + 'git+https://github.com/hpi/levelshealth', +] + +from dataclasses import dataclass +from pathlib import Path +from typing import Sequence, Iterable + +from .core import Paths, get_files + +from my.config import levelshealth as user_config + +@dataclass +class levelshealth(user_config): + # paths[s]/glob to the exported JSON data + export_path: Paths + + +def inputs() -> Sequence[Path]: + return get_files(levelshealth.export_path) + + +import levelshealth.dal as dal + + +def glucoseScores(): + _dal = dal.DAL(inputs()) + yield from _dal.glucoseScores() + +def zones(): + _dal = dal.DAL(inputs()) + yield from _dal.zones() + +def streaks(): + _dal = dal.DAL(inputs()) + yield from _dal.streaks() +