]> Nutra Git (v1) - nutratech/cli.git/commitdiff
wip nnest, want to color code & tree view `anl`
authorShane Jaroch <chown_tee@proton.me>
Wed, 7 Jun 2023 11:11:26 +0000 (07:11 -0400)
committerShane Jaroch <chown_tee@proton.me>
Wed, 7 Jun 2023 11:12:45 +0000 (07:12 -0400)
ntclient/core/nnest.py

index fba911cf37e9e04bba1feb87c8412b2c1dc7bad5..66dfc4de623320219b0e78b6c1dde4c3c11d9a7b 100644 (file)
@@ -5,8 +5,27 @@ Created on Sat Aug 29 19:43:55 2020
 @author: shane
 """
 
+
+# pylint: disable=too-few-public-methods
+class Nutrient:
+    """Tracks properties of nutrients; used in the tree structure of nutrient groups"""
+
+    def __init__(self, nut_id: int, name: str, hidden: bool = False):
+        self.nut_id = nut_id
+        self.name = name
+        self.hidden = hidden
+
+
 nnest = {
-    "basics": ["Protein", "Carbs", "Fats", "Fiber", "Calories"],
+    # "basics": ["Protein", "Carbs", "Fats", "Fiber", "Calories"],
+    "basics": {
+        # 203: {"name": "Protein", "hidden": False},
+        203: Nutrient(203, "Protein"),
+        205: "Carbs",
+        204: "Fats",
+        291: "Fiber",
+        208: "Calories (kcal)",
+    },
     "macro_details": {"Carbs": {}, "Fat": {}},
     "micro_nutrients": {
         "Vitamins": {"Water-Soluble": {}, "Fat-Soluble": {}},