radboy 0.0.374__py3-none-any.whl → 0.0.375__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.

@@ -18,7 +18,8 @@ from radboy.DB.CoinCombo import *
18
18
  from radboy.DayLog.Wavelength4Freq import HoleSize
19
19
  from radboy.DayLog.TaxiFares import TaxiFare
20
20
  from radboy.Compare.Compare import *
21
-
21
+ from sqlalchemy.sql import functions as func
22
+ from collections import OrderedDict
22
23
 
23
24
  class DayLogger:
24
25
  helpText=f"""
@@ -754,7 +755,9 @@ fxtbl - update table with correct columns
754
755
  """)
755
756
  if totals[i] >= occurances and totals[i] <= occurances_max:
756
757
  print(msg)
757
-
758
+ def f_orderByTotalValue(self,query):
759
+ #just a dummy extra filtering can be here
760
+ return query
758
761
 
759
762
  def TotalSpent(self):
760
763
  LookUpState=db.detectGetOrSet('list maker lookup order',False,setValue=False,literal=False)
@@ -769,6 +772,22 @@ fxtbl - update table with correct columns
769
772
  #cost report
770
773
  #export results Both text and xlsx
771
774
  #yes no
775
+ orderByTotalValue=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Order Final Results by total qty value[y/N]:",helpText="yes or no; default is No.",data="boolean")
776
+
777
+ if orderByTotalValue in [None,]:
778
+ return
779
+ elif orderByTotalValue in ['d',]:
780
+ orderByTotalValue=False
781
+
782
+ reverse=True
783
+ if orderByTotalValue:
784
+ reverse=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Order Asc(True/Yes/First Line Newest or Smallest & Last Line Biggest or Oldest)[Default]/Desc(false/no/First Line Oldest or Biggest & Last Line Newest or Smallest):",helpText="yes or no; default is yes.",data="boolean")
785
+
786
+ if reverse in [None,]:
787
+ return
788
+ elif reverse in ['d',]:
789
+ reverse=True
790
+
772
791
  graph_it=Prompt.__init2__(None,func=FormBuilderMkText,ptext="Graph Results (if possible)[y/N]:",helpText="yes or no; default is No.",data="boolean")
773
792
 
774
793
  if graph_it in [None,]:
@@ -920,6 +939,9 @@ fxtbl - update table with correct columns
920
939
  x=GraphIt(query,fields_for_total)
921
940
  if x is None:
922
941
  return
942
+ if orderByTotalValue:
943
+ query=self.f_orderByTotalValue(query)
944
+
923
945
  query=query.all()
924
946
  else:
925
947
  query=session.query(DayLog).filter(DayLog.DayLogDate.between(date_from,date_to))
@@ -933,6 +955,9 @@ fxtbl - update table with correct columns
933
955
  x=GraphIt(query,fields_for_total)
934
956
  if x is None:
935
957
  return
958
+
959
+ if orderByTotalValue:
960
+ query=self.f_orderByTotalValue(query)
936
961
  query=query.all()
937
962
  else:
938
963
  exclude_code=Prompt.__init2__(None,func=FormBuilderMkText,ptext="exclude this code from results:",helpText="yes or no",data="boolean")
@@ -957,6 +982,10 @@ fxtbl - update table with correct columns
957
982
  query=query.order_by(DayLog.DayLogDate.asc())
958
983
  elif LookUpState == False:
959
984
  query=query.order_by(DayLog.DayLogDate.desc())
985
+
986
+ if orderByTotalValue:
987
+ query=self.f_orderByTotalValue(query)
988
+
960
989
  else:
961
990
  filt=[]
962
991
  for q in code:
@@ -977,6 +1006,8 @@ fxtbl - update table with correct columns
977
1006
  query=query.order_by(DayLog.DayLogDate.asc())
978
1007
  elif LookUpState == False:
979
1008
  query=query.order_by(DayLog.DayLogDate.desc())
1009
+ if orderByTotalValue:
1010
+ query=self.f_orderByTotalValue(query)
980
1011
  if export:
981
1012
  exporter_excel(query,xlsx_cr_export)
982
1013
  if graph_it:
@@ -984,6 +1015,8 @@ fxtbl - update table with correct columns
984
1015
  if x is None:
985
1016
  return
986
1017
 
1018
+ if orderByTotalValue:
1019
+ query=self.f_orderByTotalValue(query)
987
1020
  query=query.all()
988
1021
  else:
989
1022
  if not exclude_code:
@@ -1003,6 +1036,8 @@ fxtbl - update table with correct columns
1003
1036
  query=query.order_by(DayLog.DayLogDate.asc())
1004
1037
  elif LookUpState == False:
1005
1038
  query=query.order_by(DayLog.DayLogDate.desc())
1039
+ if orderByTotalValue:
1040
+ query=self.f_orderByTotalValue(query)
1006
1041
  else:
1007
1042
  filt=[]
1008
1043
  for q in code:
@@ -1026,19 +1061,23 @@ fxtbl - update table with correct columns
1026
1061
  query=query.order_by(DayLog.DayLogDate.asc())
1027
1062
  elif LookUpState == False:
1028
1063
  query=query.order_by(DayLog.DayLogDate.desc())
1064
+ if orderByTotalValue:
1065
+ query=self.f_orderByTotalValue(query)
1029
1066
  if export:
1030
1067
  exporter_excel(query,xlsx_cr_export)
1031
1068
  if graph_it:
1032
1069
  x=GraphIt(query,fields_for_total)
1033
1070
  if x is None:
1034
1071
  return
1072
+ if orderByTotalValue:
1073
+ query=self.f_orderByTotalValue(query)
1035
1074
  query=query.all()
1036
1075
 
1037
- totals={}
1038
- totals_dl={}
1039
- total_price={}
1040
- total_tax={}
1041
- total_crv={}
1076
+ totals=OrderedDict({})
1077
+ totals_dl=OrderedDict({})
1078
+ total_price=OrderedDict({})
1079
+ total_tax=OrderedDict({})
1080
+ total_crv=OrderedDict({})
1042
1081
  if export:
1043
1082
  msg=f'{datetime.now()}[NOW]/[{date_from}(From)]-[{date_to}(To)]'
1044
1083
  logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=text_cr_export,clear_only=True)
@@ -1098,6 +1137,19 @@ fxtbl - update table with correct columns
1098
1137
  # return
1099
1138
  #else:
1100
1139
  # pass
1140
+ #
1141
+ if orderByTotalValue:
1142
+ totals_ordered_keys=OrderedDict({})
1143
+ for key in totals:
1144
+ totals_ordered_keys[key]=round(((total_crv[key]+total_tax[key]+total_price[key])/total_expense)*100,ROUNDTO)
1145
+ #need to sort dictionary
1146
+ #according to -> round(((total_crv[key]+total_tax[key]+total_price[key])/total_expense)*100,ROUNDTO)
1147
+ totals_ordered_keys=OrderedDict(sorted(totals_ordered_keys.items(),key=lambda item:item[1],reverse=not reverse))
1148
+ tmp=OrderedDict()
1149
+ for key in totals_ordered_keys.keys():
1150
+ tmp[key]=totals[key]
1151
+ totals=tmp
1152
+
1101
1153
  totals_len=len(totals)
1102
1154
  for num,key in enumerate(totals):
1103
1155
  if LookUpState == True:
@@ -1115,7 +1167,8 @@ fxtbl - update table with correct columns
1115
1167
  if export:
1116
1168
  logInput(msg,user=False,filter_colors=True,maxed_hfl=False,ofile=text_cr_export)
1117
1169
  print(msg)
1118
- msg3=f"{Fore.orange_red_1}Total Expense:{Fore.light_magenta}{total_expense}{Style.reset}"
1170
+ reverse_state={False:'False - Desc. (First Line Oldest/Biggest,Last Line Newest/Smallest)',True:'True - Asc. (Firt Line Newest/Smallest,Last Line Newest/Biggest)'}
1171
+ msg3=f"{Fore.light_cyan}Final Results Reverse:{reverse_state[reverse]}|{Fore.orange_red_1}Total Expense:{Fore.light_magenta}{total_expense}{Style.reset}"
1119
1172
  print(msg3)
1120
1173
  if export:
1121
1174
  logInput(msg3,user=False,filter_colors=True,maxed_hfl=False,ofile=text_cr_export)
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.374'
1
+ VERSION='0.0.375'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.374
3
+ Version: 0.0.375
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=XXy-o5Z_yOgrgHNju4iqM3h7xhRBkNIoHG1qePtBnGY,41316
7
7
  radboy/Run.py,sha256=JUoCTHnzQBv7n8PB2_i93ANdAC_iW__RkAge8esCnk4,76
8
- radboy/__init__.py,sha256=RubYMuOG7VFG0QXDgZQKkBcxURJdyRwFQ9wQIx5YVys,17
8
+ radboy/__init__.py,sha256=KkKoK-XRLCOcRxD6MqPSTFGhXXrU0U7EUWZBjTbh3iU,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
@@ -134,13 +134,13 @@ radboy/DB/__pycache__/renderText2Png.cpython-311.pyc,sha256=ivSzvyAeWhsS-a_RcFF8
134
134
  radboy/DB/__pycache__/renderText2Png.cpython-312.pyc,sha256=1CUGjOhJw_vC4DNMQ-W5jBXEKp7HzDrq7--x9VyBTo8,8991
135
135
  radboy/DB/__pycache__/renderText2Png.cpython-313.pyc,sha256=LDJOo7uFztlxw3ptN8QuHrLkr0GKiAArBu34QiE15iQ,9096
136
136
  radboy/DB/__pycache__/testClass.cpython-311.pyc,sha256=nkWap8RuBsWWOB_ZhGbR3ELbnL1F1CHZCi0dpepqw-0,1225
137
- radboy/DayLog/DayLogger.py,sha256=cs_8XXO0yPbUJEh2V_22ev8ZqhAIODgJatuacGZz_cw,98586
137
+ radboy/DayLog/DayLogger.py,sha256=63N1oJ_5tq1QJPCSLMffhFQgrg4gW8tFOi2Ftb5rSs8,101456
138
138
  radboy/DayLog/TaxiFares.py,sha256=3slYjtBcTnRe8IeneJ-_iZJJ3E7alW09f6GWYXPxhOo,10882
139
139
  radboy/DayLog/Wavelength4Freq.py,sha256=MfN2EATrN3bbEDgP1qOPjV1Fk8sVnkc_4tgX6sKfSE0,2054
140
140
  radboy/DayLog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
141
  radboy/DayLog/__pycache__/DayLogger.cpython-311.pyc,sha256=TmRnRZHp5tMTokSEB8hWTxnasi-iJdh6TmYcb_nXGoY,29557
142
142
  radboy/DayLog/__pycache__/DayLogger.cpython-312.pyc,sha256=bfDCQZrIhgQYzoUle7roicRE_bhGPYZtIbCRIiDrsxU,68240
143
- radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc,sha256=9JJ5eSMw7twg7Px0Lf_5dDZRnRLCgic3pkHaqkduHr8,147105
143
+ radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc,sha256=kRcVAtHpS_R-XMHGw5mvx9xtMMJ5s2PY4hZHV4CQumc,149602
144
144
  radboy/DayLog/__pycache__/__init__.cpython-311.pyc,sha256=Z5Y4DdVF77LZf6-Of92MDGFdi-IXik1ASQd4AdLNNfQ,231
145
145
  radboy/DayLog/__pycache__/__init__.cpython-312.pyc,sha256=lP_GHzSPt5JTrT1jLWiRMFGPmSdJYBn4eRV__OxgJ6s,269
146
146
  radboy/DayLog/__pycache__/__init__.cpython-313.pyc,sha256=UQw5v4r7yismC9qcqP0dEme6h-lawbOA5pXYpkqUwFk,148
@@ -386,7 +386,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
386
386
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
387
387
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
388
388
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
389
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=Y9yK0KEannCV4hOInwUjLrJtq0VQIB3iYXcnNlcPlqs,165
389
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=jJdzze-Djxkbo9dbe5opc_tJEHQ0DH3lAj-tMS00_ek,165
390
390
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
391
391
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
392
392
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -411,7 +411,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
411
411
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
412
412
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
413
413
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
414
- radboy-0.0.374.dist-info/METADATA,sha256=xm2KS2gomT9p-HiGzOzTdS2JnjAdg2WaJaOtJNt_TIw,794
415
- radboy-0.0.374.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
- radboy-0.0.374.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
- radboy-0.0.374.dist-info/RECORD,,
414
+ radboy-0.0.375.dist-info/METADATA,sha256=Uw2CQ1E_OhRLZC955qPzJ01mDCU1z_U5AGkDtjIvB0U,794
415
+ radboy-0.0.375.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
+ radboy-0.0.375.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
+ radboy-0.0.375.dist-info/RECORD,,