radboy 0.0.446__py3-none-any.whl → 0.0.448__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of radboy might be problematic. Click here for more details.

@@ -2,6 +2,65 @@ from . import *
2
2
 
3
3
 
4
4
  class CookBookUi:
5
+ def total_rcp(self):
6
+ with Session(ENGINE) as session:
7
+ rcp=self.ls_rcp_names(asSelector=True,whole=True,names=True)
8
+ if rcp is None:
9
+ print("User returned, or no results!")
10
+ return
11
+ ct=len(rcp[0])
12
+ htext=[]
13
+ for i in rcp[0]:
14
+ htext.append(i)
15
+ htext='\n'.join(htext)
16
+ print(htext)
17
+ which=Prompt.__init2__(self,func=FormBuilderMkText,ptext="which index",helpText=f"{htext}\nindex of rcp to edit",data="integer")
18
+ if which in [None,'d']:
19
+ return
20
+ try:
21
+ totals={
22
+ "carb_per_serving":None,
23
+ "fiber_per_serving":None,
24
+ "protien_per_serving":None,
25
+ "total_fat_per_serving":None,
26
+ "saturated_fat_per_serving":None,
27
+ "trans_fat_per_serving":None,
28
+ "sodium_per_serving":None,
29
+ "cholesterol_per_serving":None,
30
+ "vitamin_d":None,
31
+ "calcium":None,
32
+ "iron":None,
33
+ "potassium":None,
34
+ }
35
+ ingredients=session.query(CookBook).filter(CookBook.recipe_uid==rcp[-1][which].recipe_uid).all()
36
+ last_unit=None
37
+ for i in ingredients:
38
+ for num,k in enumerate(totals):
39
+ try:
40
+ qty=getattr(i,k)
41
+ unit=getattr(i,f'{k}_unit')
42
+ QTY=pint.Quantity(qty,unit)
43
+
44
+ used=pint.Quantity(i.IngredientQty,i.IngredientQtyUnit)
45
+ servingSize=pint.Quantity(i.Serving_Size,i.Serving_Size_unit)
46
+ ck=Fore.orange_red_1
47
+ if (num%2)!=0 and num != 0:
48
+ ck=Fore.light_steel_blue
49
+ print(f"{ck}{i.recipe_name}|{i.IngredientName}|{k}={QTY}|amount used={used}|servingSize={servingSize}|used/servingSize={used/servingSize}|QTY*(used/servingSize)={QTY*(used/servingSize)}{Style.reset}")
50
+ if totals[k] is None:
51
+ totals[k]=QTY*(used/servingSize)
52
+ else:
53
+ totals[k]+=(QTY*(used/servingSize))
54
+
55
+ except Exception as e:
56
+ print(e,f"'{Fore.cyan}{k}{Style.reset}'wont be added to totals")
57
+ ct=len(totals)
58
+ for num,k in enumerate(totals):
59
+ print(std_colorize(f"{k} = {totals[k]}",num,ct))
60
+ print("Done Totaling!")
61
+ except Exception as e:
62
+ print(e)
63
+ #edit everything found by searchtext using recipe_uid as the final selection parameter
5
64
  def create_new_rcp(self):
6
65
  with Session(ENGINE) as session:
7
66
  uid=uuid1()
@@ -129,6 +188,9 @@ class CookBookUi:
129
188
  def rm_rcp(self):
130
189
  with Session(ENGINE) as session:
131
190
  rcp=self.ls_rcp_names(asSelector=True,whole=True,names=True)
191
+ if rcp is None:
192
+ print("User returned, or no results!")
193
+ return
132
194
  ct=len(rcp[0])
133
195
  htext=[]
134
196
  for i in rcp[0]:
@@ -149,6 +211,9 @@ class CookBookUi:
149
211
  def edit_rcp(self):
150
212
  with Session(ENGINE) as session:
151
213
  rcp=self.ls_rcp_names(asSelector=True,whole=True,names=True)
214
+ if rcp is None:
215
+ print("User returned, or no results!")
216
+ return
152
217
  ct=len(rcp[0])
153
218
  htext=[]
154
219
  for i in rcp[0]:
@@ -177,6 +242,9 @@ class CookBookUi:
177
242
  def rm_ingredient(self):
178
243
  with Session(ENGINE) as session:
179
244
  rcp=self.ls_rcp_names(asSelector=True,whole=True,names=True)
245
+ if rcp is None:
246
+ print("User returned, or no results!")
247
+ return
180
248
  ct=len(rcp[0])
181
249
  htext=[]
182
250
  for i in rcp[0]:
@@ -255,6 +323,9 @@ class CookBookUi:
255
323
  def ls_rcp_ingredients(self):
256
324
  with Session(ENGINE) as session:
257
325
  rcp=self.ls_rcp_names(asSelector=True,whole=True,names=True)
326
+ if rcp is None:
327
+ print("User returned, or no results!")
328
+ return
258
329
  ct=len(rcp[0])
259
330
  htext=[]
260
331
  for i in rcp[0]:
@@ -277,6 +348,9 @@ class CookBookUi:
277
348
  def edit_rcp_ingredients(self):
278
349
  with Session(ENGINE) as session:
279
350
  rcp=self.ls_rcp_names(asSelector=True,whole=True,names=True)
351
+ if rcp is None:
352
+ print("User returned, or no results!")
353
+ return
280
354
  ct=len(rcp[0])
281
355
  htext=[]
282
356
  for i in rcp[0]:
@@ -354,6 +428,11 @@ class CookBookUi:
354
428
  'desc':"edit recipe names and instructions",
355
429
  'exec':lambda self=self:self.edit_rcp(),
356
430
  },
431
+ uuid1():{
432
+ 'cmds':generate_cmds(startcmd=['ttl','total',],endCmd=['rcp','recipe']),
433
+ 'desc':"total nutritional facts",
434
+ 'exec':lambda self=self:self.total_rcp(),
435
+ },
357
436
  }
358
437
 
359
438
  htext=[]
Binary file
radboy/DB/db.py CHANGED
@@ -5202,6 +5202,12 @@ class CookBook(BASE,Template):
5202
5202
  IngredientQty=Column(Float,default=None)
5203
5203
  IngredientQtyUnit=Column(String,default="gram")
5204
5204
 
5205
+ Serving_Size=Column(Float,default=None)
5206
+ Serving_Size_unit=Column(String,default="gram")
5207
+
5208
+ Servings_Per_Container=Column(Float,default=None)
5209
+ Servings_Per_Container_unit=Column(String,default="")
5210
+
5205
5211
  carb_per_serving=Column(Float,default=None)
5206
5212
  carb_per_serving_unit=Column(String,default="gram")
5207
5213
 
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.446'
1
+ VERSION='0.0.448'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.446
3
+ Version: 0.0.448
4
4
  Summary: A small example package
5
5
  Author: Carl Joseph Hirner III
6
6
  Author-email: Carl Hirner III <k.j.hirner.wisdom@gmail.com>
@@ -5,7 +5,7 @@ radboy/Holidays.txt,sha256=y-JZPihh5iaWKxMIHNXD39yVuVmf1vMs4FdNDcg0f1Y,3114
5
5
  radboy/InventoryGlossary.txt,sha256=018-Yqca6DFb10jPdkUY-5qhkRlQN1k3rxoTaERQ-LA,91008
6
6
  radboy/RecordMyCodes.py,sha256=dOm24buf-rWC4FGLQLDjL5obdxOKF3D01t6Qkkit-R0,41421
7
7
  radboy/Run.py,sha256=JUoCTHnzQBv7n8PB2_i93ANdAC_iW__RkAge8esCnk4,76
8
- radboy/__init__.py,sha256=wcDStHyBxLpSEKOCtqi1zLg7IQBZDcrpnO0Gcy1iE4s,17
8
+ radboy/__init__.py,sha256=mJcf1CUMYI5DRC0URmpZD-bQyOHh7kSQ7OLAJo2TTlo,17
9
9
  radboy/api_key,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  radboy/case-export-2024-05-14-13-10-00.672971.xlsx,sha256=Wd592d_VLFmfUI9KKKSVjNwjV91euc1T7ATyvwvUhlg,5431
11
11
  radboy/case-export-2024-05-14-13-13-22.540614.xlsx,sha256=OnGrhmScHfGp_mVaWW-LNMsqrQgyZDpiU3wV-2s3U5Q,5556
@@ -75,7 +75,7 @@ radboy/ConvertCode/__pycache__/__init__.cpython-311.pyc,sha256=1-K1vfRZxAs9MoOyy
75
75
  radboy/ConvertCode/__pycache__/__init__.cpython-312.pyc,sha256=77LSCMdrPg91lbsloPumUo1SpAt5A8l1WPgTxGIvwTs,274
76
76
  radboy/ConvertCode/__pycache__/__init__.cpython-313.pyc,sha256=4F9h0V0Z5sQHdZQGEsnfCSLMQK4lUD5CzJwU4Elv-EU,153
77
77
  radboy/ConvertCode/__pycache__/codep.cpython-311.pyc,sha256=-qJqPEjGOP1-x6Xw6W4Msfuu2iwVffN_-DerH18Is2o,1086
78
- radboy/CookBook/CookBook.py,sha256=ZKjSkvLXoPL0eCxjLrySeF7Gjh_n1CJRQqYj0Kaju00,14132
78
+ radboy/CookBook/CookBook.py,sha256=sL1aznqpRIRu6WN3eq28Q6fzi_QqhzfUsCJwYrBtEyI,16760
79
79
  radboy/CookBook/__init__.py,sha256=svTiqqFxHZeqYCRorLx6qLxL3oI1pil4fxomm-kkQ88,927
80
80
  radboy/DB/CoinCombo.py,sha256=NJfTmx3XYgS41zkAyyO2W6de1Mj3rWsCWqU4ikHfvJI,13604
81
81
  radboy/DB/DatePicker.py,sha256=6eNjmryFWPpzrRYmI418UwSGin3XpJlL52h8cauanbY,18004
@@ -92,7 +92,7 @@ radboy/DB/SMLabelImporter.py,sha256=eUoBDxVUUEKGL2g_PwkASM67ZB7FmXtSnn4bCagskhY,
92
92
  radboy/DB/__init__.py,sha256=JiigA9B7GalP7YuRdcwyGDu5PDSBahoi0lLjtScxlN8,49
93
93
  radboy/DB/blankDataFile.py,sha256=YX_05Usi71UpDkZN9UTMYwUipbTndTAtEgqzBEga0kE,9285
94
94
  radboy/DB/config.py,sha256=bvu43dUl1_yO3Zq3gsLuenGUgJSiS3S9Cs6ppFEvZbg,239
95
- radboy/DB/db.py,sha256=IfAxy3rE6cnyyAJT9L0hu95Rsn67ljmLEy-Mi3iH-gU,239987
95
+ radboy/DB/db.py,sha256=0qgG_wF14-jsUmawNeSRqkceapQbY-oByCLBiM3Uo3A,240197
96
96
  radboy/DB/glossary_db.py,sha256=1_qxeEpjjEtpWB_eDjsgJisimLv7OBm75MuqM-Lt6zg,28218
97
97
  radboy/DB/masterLookup.py,sha256=DBaM2uscG3_X5dek49wjdnOzhrjWhKgvOEz_umdz0mY,4566
98
98
  radboy/DB/msg.txt,sha256=YxWed6A6tuP1djJ5QPS2Rz3ING4TKKf8kUiCCPtzHXE,7937
@@ -127,7 +127,7 @@ radboy/DB/__pycache__/config.cpython-312.pyc,sha256=Qo7E6MHrF6yqvKgepNFyCoekZXiv
127
127
  radboy/DB/__pycache__/config.cpython-313.pyc,sha256=_8wCIg_3jhyJjxnExD2Sm6aY-uZTw036p7Ki5znL7dc,376
128
128
  radboy/DB/__pycache__/db.cpython-311.pyc,sha256=rNgigyBd0D-cg1JxKAS8t0B_k0IEJivgVlRaZE10Xis,210105
129
129
  radboy/DB/__pycache__/db.cpython-312.pyc,sha256=ANDJPC0RoavbmSKFxG15vC7B4rEGyVt7xRJt7XGY3OA,334609
130
- radboy/DB/__pycache__/db.cpython-313.pyc,sha256=NCtdFi-lav2m3SShNb4If3YUY5E5Tep1pszMvddk0jM,378883
130
+ radboy/DB/__pycache__/db.cpython-313.pyc,sha256=GQIVxeVDRS3NYC7VUirhhnb4lKRD7284BxAK0h-7a-s,379076
131
131
  radboy/DB/__pycache__/glossary_db.cpython-312.pyc,sha256=8UL-29cKqtKovx0BANm6kzKKteef1BW_2qF3wumzst4,36023
132
132
  radboy/DB/__pycache__/glossary_db.cpython-313.pyc,sha256=Ke9bkvllGv5CK0JdT9DRvQ3MOdrXxoYv7TVLNkqLux0,36582
133
133
  radboy/DB/__pycache__/masterLookup.cpython-312.pyc,sha256=bQiOkmMwwHgcO18tYSWGQ-YUff4GQlKVhBMp1GoWAqY,6324
@@ -394,7 +394,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
394
394
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
395
395
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
396
396
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
397
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=VjvyFLJqsRJ68CbsnhY8iv-FpZk-AuYhc2Xq5OtLNeE,165
397
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=c9IK93rkZ6l-2Il102XrIbsqDZk7nno2ugeu3Dv5Rxg,165
398
398
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
399
399
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
400
400
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -419,7 +419,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
419
419
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
420
420
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
421
421
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
422
- radboy-0.0.446.dist-info/METADATA,sha256=Gzj19N35zq39hMRdsei1IEVi92QuFKN_EuYMMCeWISU,1574
423
- radboy-0.0.446.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
424
- radboy-0.0.446.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
425
- radboy-0.0.446.dist-info/RECORD,,
422
+ radboy-0.0.448.dist-info/METADATA,sha256=x-4AngNWw9OELOpN9yQdx0q2h17uCTu-2AZKovjNesw,1574
423
+ radboy-0.0.448.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
424
+ radboy-0.0.448.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
425
+ radboy-0.0.448.dist-info/RECORD,,