new: levels health
This commit is contained in:
parent
1eb8d067c5
commit
7e584586bb
1 changed files with 41 additions and 0 deletions
41
my/levelshealth.py
Normal file
41
my/levelshealth.py
Normal file
|
@ -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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue