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

@@ -16,6 +16,7 @@ from radboy.whatIs15 import get_bill_combinations
16
16
  from radboy.DB.PayDay import EstimatedPayCalendar,setup
17
17
  from radboy.DB.CoinCombo import *
18
18
  from radboy.DayLog.Wavelength4Freq import HoleSize
19
+ from radboy.DayLog.TaxiFares import TaxiFare
19
20
 
20
21
 
21
22
  class DayLogger:
@@ -68,8 +69,8 @@ fxtbl - update table with correct columns
68
69
  {Fore.light_sea_green}'prc chng','prcchng','prc.chng','prc_chng','prc-chng','price change' {Fore.light_steel_blue}- detect price change over a date-range{Style.reset}
69
70
  {Fore.light_sea_green}'cr','ttl spnt','ttlspnt','cost report','cst rpt'{Fore.light_steel_blue}- generate an expense/cost report for a date-range{Style.reset}
70
71
  {Fore.light_sea_green}'epdc','estimated pay day calendar'{Fore.light_steel_blue}- review your estimated paydays{Style.reset}
71
- Not Really Related
72
- {Fore.light_sea_green}'faraday','holesize'{Fore.light_steel_blue}- get wavelength needed for a frequency/for making a faraday cage{Style.reset}
72
+ {Fore.light_sea_green}'taxi fare','calc taxi fare','ctf','taxi'{Fore.light_steel_blue}- Calculate Taxi Fares{Style.reset}
73
+ {Fore.light_sea_green}'faraday','holesize','frdy hs'{Fore.light_steel_blue}- get wavelength needed for a frequency/for making a faraday cage {Fore.orange_red_1}[Indirectly Related]{Style.reset}
73
74
  """
74
75
  def listAllDL(self):
75
76
  with Session(self.engine) as session:
@@ -1823,8 +1824,10 @@ Not Really Related
1823
1824
  EstimatedPayCalendar(**setup())
1824
1825
  elif what.lower() in ['coin']:
1825
1826
  CoinComboUtil()
1826
- elif what.lower() in ['faraday','holesize']:
1827
+ elif what.lower() in ['faraday','faraday holesize','frdy hs']:
1827
1828
  HoleSize()
1829
+ elif what.lower() in ['taxi fare','calc taxi fare','ctf','taxi']:
1830
+ TaxiFare()
1828
1831
 
1829
1832
 
1830
1833
 
@@ -1,13 +1,190 @@
1
- #yellow cab taxi fare calculator
2
- #rates
3
-
1
+ from datetime import datetime,timedelta
2
+ from dateutil.relativedelta import relativedelta as relativedelta
3
+ import pint
4
+ import numpy as np
5
+ from radboy.DB.db import *
6
+ from radboy.DB.Prompt import *
7
+ from radboy.FB.FBMTXT import *
8
+ from radboy.FB.FormBuilder import *
9
+ from colored import Fore,Back,Style
10
+ from uuid import uuid1
11
+ #rates provided as default and as user input via formbuilder
4
12
  class TaxiFare:
5
- per_1_14_mile=0.25
6
- flag_drop=3.50
7
- per_mile=per_1_14_mile*14
8
- airport_surcharge_pickup=3
9
- airport_surcharge_dropoff=3
10
- wait_time_per_hour_cost=35
11
-
12
- def __init__(self):
13
- pass
13
+ def static_colorize(self,m,n,c):
14
+ msg=f'{Fore.cyan}{n}/{Fore.light_yellow}{n+1}{Fore.light_red} of {c} {Fore.dark_goldenrod}{m}{Style.reset}'
15
+ return msg
16
+ per_1_14_mile=0.25
17
+ flag_drop=3.50
18
+ per_mile=per_1_14_mile*14
19
+ airport_surcharge_pickup=3
20
+ airport_surcharge_dropoff=3
21
+ wait_time_per_hour_cost=35
22
+ def RateData_SalinasYellowCab(self,per_1_14_mile,per_mile,flag_drop,airport_surcharge_pickup,airport_surcharge_dropoff,wait_time_per_hour_cost):
23
+ rate_data={
24
+ 'per_1_14_mile':{
25
+ 'type':'float',
26
+ 'default':per_1_14_mile,
27
+ },
28
+ 'flag_drop':{
29
+ 'type':'float',
30
+ 'default':flag_drop
31
+ },
32
+ 'per_mile':{
33
+ 'type':'float',
34
+ 'default':per_mile,
35
+ },
36
+ 'airport_surcharge_pickup':{
37
+ 'type':'float',
38
+ 'default':airport_surcharge_pickup
39
+ },
40
+ 'airport_surcharge_dropoff':{
41
+ 'type':'float',
42
+ 'default':airport_surcharge_dropoff
43
+ },
44
+ 'wait_time_per_hour_cost':{
45
+ 'type':'float',
46
+ 'default':wait_time_per_hour_cost
47
+ },
48
+ }
49
+ rate_data=FormBuilder(data=rate_data)
50
+ if rate_data is None:
51
+ print(self.QUIT_EARLY)
52
+ return None
53
+
54
+ recalculate_miles_from_1_14_mile=Prompt.__init2__(None,func=FormBuilderMkText,ptext=f"Recalculate Per_Mile Cost using {per_1_14_mile}:",helpText="Boolean True/Y/n/Boolean False (but not f)",data="boolean")
55
+ if recalculate_miles_from_1_14_mile is None:
56
+ print(self.QUIT_EARLY)
57
+ return None
58
+ elif recalculate_miles_from_1_14_mile in ['d',]:
59
+ rate_data['per_mile']=rate_data['per_1_14_mile']*14
60
+ print(self.static_colorize(str(rate_data),0,1))
61
+ return rate_data
62
+
63
+ def print_rates(self):
64
+ x=6
65
+ msf=[
66
+ self.static_colorize(f"{Fore.light_cyan}Per 1/14 Mile{Fore.magenta}={Fore.dark_goldenrod}{self.per_1_14_mile}",0,x),
67
+ self.static_colorize(f"{Fore.light_cyan}Per Mile{Fore.magenta}={Fore.dark_goldenrod}{self.per_mile}",1,x),
68
+ self.static_colorize(f"{Fore.light_cyan}Flag Drop{Fore.magenta}={Fore.dark_goldenrod}{self.flag_drop}",2,x),
69
+ self.static_colorize(f"{Fore.light_cyan}Airport Surcharge Pickup{Fore.magenta}={Fore.dark_goldenrod}{self.airport_surcharge_pickup}",3,x),
70
+ self.static_colorize(f"{Fore.light_cyan}Airport Surcharge Drop Off{Fore.magenta}={Fore.dark_goldenrod}{self.airport_surcharge_dropoff}",4,x),
71
+ self.static_colorize(f"{Fore.light_cyan}Wait Time Per Hour Cost{Fore.magenta}={Fore.dark_goldenrod}{self.wait_time_per_hour_cost}",5,x),
72
+ ]
73
+ for line in msf:
74
+ print(line)
75
+
76
+ def __init__(self,per_1_14_mile=None,flag_drop=None,per_mile=None, airport_surcharge_pickup=None,airport_surcharge_dropoff=None,wait_time_per_hour_cost=None):
77
+ if isinstance(per_1_14_mile,float):
78
+ self.per_1_14_mile=per_1_14_mile
79
+
80
+ if isinstance(flag_drop,float):
81
+ self.flag_drop=flag_drop
82
+
83
+ if isinstance(per_mile,float):
84
+ self.per_mile=per_mile
85
+
86
+ if isinstance(airport_surcharge_pickup,float):
87
+ self.airport_surcharge_pickup=airport_surcharge_pickup
88
+
89
+ if isinstance(airport_surcharge_dropoff,float):
90
+ self.airport_surcharge_dropoff=airport_surcharge_dropoff
91
+
92
+ if isinstance(wait_time_per_hour_cost,float):
93
+ self.wait_time_per_hour_cost=wait_time_per_hour_cost
94
+
95
+ self.ROUNDTO=int(detectGetOrSet("TaxiFare ROUNDTO default",3,setValue=False,literal=True))
96
+
97
+ cmds={
98
+ str(uuid1()):{
99
+ 'cmds':['set rates','strt'],
100
+ 'desc':"Set Taxi Fare Rates if needed!",
101
+ 'exec':lambda per_1_14_mile=self.per_1_14_mile,flag_drop=self.flag_drop,per_mile=self.per_mile,airport_surcharge_pickup=self.airport_surcharge_pickup,airport_surcharge_dropoff=self.airport_surcharge_dropoff,wait_time_per_hour_cost=self.wait_time_per_hour_cost,self=self:self.RateData_SalinasYellowCab(per_1_14_mile,flag_drop,per_mile, airport_surcharge_pickup,airport_surcharge_dropoff,wait_time_per_hour_cost)
102
+ },
103
+ str(uuid1()):{
104
+ 'cmds':['calc fare','clcfr'],
105
+ 'desc':"calculate fare estimate using provided values for fare rates set and user values like distance,how_long_may_the_ride_be_hours,airport_surcharge_pickup_bool, and airport_surcharge_dropoff_bool",
106
+ 'exec':self.calc_fare
107
+ },
108
+ str(uuid1()):{
109
+ 'cmds':['show rates','shw rts','print rates','prt rts','rates'],
110
+ 'desc':"calculate fare estimate using provided values for fare rates set and user values like distance,how_long_may_the_ride_be_hours,airport_surcharge_pickup_bool, and airport_surcharge_dropoff_bool",
111
+ 'exec':self.print_rates
112
+ }
113
+
114
+ }
115
+ helptext=[]
116
+ ct=len(cmds)
117
+ for num,i in enumerate(cmds):
118
+ msg=self.static_colorize(f"{cmds[i]['cmds']} - {cmds[i]['desc']}",num,ct)
119
+ helptext.append(msg)
120
+ helptext='\n'.join(helptext)
121
+ while True:
122
+ try:
123
+ doWhat=Prompt.__init2__(self,func=FormBuilderMkText,ptext=f"Do What?:",helpText=helptext,data="string")
124
+ if doWhat is None:
125
+ print(self.PREVIOUS_MENU)
126
+ return
127
+ elif doWhat.lower() in ['d',]:
128
+ print(helptext)
129
+ continue
130
+ for i in cmds:
131
+ if doWhat.lower() in [i.lower() for i in cmds[i]['cmds']]:
132
+ if callable(cmds[i]['exec']):
133
+ cmds[i]['exec']()
134
+ break
135
+ else:
136
+ print("cmd is not callable()")
137
+ except Exception as e:
138
+ print(e)
139
+ PREVIOUS_MENU=f"{Fore.light_yellow}Going to previous menu!{Style.reset}"
140
+ QUIT_EARLY=f"{Fore.light_red}Nothing was calculated: {Fore.light_steel_blue}User Quit() Early!{Style.reset}"
141
+
142
+ def calc_fare(self):
143
+ total=0
144
+
145
+ miles_traveled=10 #user provided
146
+ airport_surcharge_dropoff_bool=False #user provided
147
+ airport_surcharge_pickup_bool=False #user provided
148
+ how_long_may_the_ride_be_hours=0 #user provided
149
+
150
+ fare_data={
151
+ 'miles_traveled':{
152
+ 'type':'float',
153
+ 'default':0,
154
+ },
155
+ 'airport_surcharge_pickup_bool':{
156
+ 'type':'boolean',
157
+ 'default':False,
158
+ },
159
+ 'airport_surcharge_dropoff_bool':{
160
+ 'type':'boolean',
161
+ 'default':False,
162
+ },
163
+ 'how_long_may_the_ride_be_hours':{
164
+ 'type':'float',
165
+ 'default':0,
166
+ }
167
+ }
168
+ fd=FormBuilder(data=fare_data)
169
+ if fd is None:
170
+ print(self.QUIT_EARLY)
171
+ return
172
+
173
+ miles_traveled=fd['miles_traveled']#user provided
174
+ airport_surcharge_dropoff_bool=fd['airport_surcharge_dropoff_bool'] #user provided
175
+ airport_surcharge_pickup_bool=fd['airport_surcharge_pickup_bool'] #user provided
176
+ how_long_may_the_ride_be_hours=fd['how_long_may_the_ride_be_hours'] #user provided
177
+
178
+ cost4miles_traveled=miles_traveled*(self.per_1_14_mile*14)
179
+ total+=cost4miles_traveled
180
+ if airport_surcharge_dropoff_bool:
181
+ total+=self.airport_surcharge_dropoff
182
+ if airport_surcharge_pickup_bool:
183
+ total+=self.airport_surcharge_pickup
184
+
185
+ total+=(how_long_may_the_ride_be_hours*self.wait_time_per_hour_cost)
186
+
187
+ total+=self.flag_drop
188
+ print(self.static_colorize(f"Taxi Fare Estimate: ${round(total,self.ROUNDTO)}",0,1))
189
+ return total
190
+
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.339'
1
+ VERSION='0.0.340'
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.339
3
+ Version: 0.0.340
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=yY1tCB_yLpF94VbNd-KM8XfeHTAM-v0v3h4V4u1oF0o,17
8
+ radboy/__init__.py,sha256=AxxdnJJoKNzxeZWp0ZDw8_cq1_iBZ8KXtVBYmM6h22o,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=PZycS7gowOlH0VKYFM7rStZY-VpSFRKVMfK97Tp8PSM,95213
138
- radboy/DayLog/TaxiFares.py,sha256=uF28hByUq9X4wv3cN4kQXAlPrqDTfwQL5utMUmhY7bY,234
137
+ radboy/DayLog/DayLogger.py,sha256=U_dzFuYhA9l0_CruVpAIvW6l56pidbEDUyr4rdMTX9w,95550
138
+ radboy/DayLog/TaxiFares.py,sha256=tSg0imuhXSi2FgbV_VBiKF0blTw4bjQGHTqRQ-jtxLo,8072
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=-tQhX0QBYsk1nh1MPPw6Mg_a5OmD1tJxfJOjYGO9Y7k,142713
143
+ radboy/DayLog/__pycache__/DayLogger.cpython-313.pyc,sha256=UC2v9eX_1UZNgIA9baQzrUMehGERHJFbBKHG_WtcH-M,143276
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=3bNIy-sJTRWsO9yrcvYPsAuoY2QVVt-NIUvQu3z5Ufg,165
389
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=z1Ld0UQxFvWylbzd4b7Sr4PHquFRg9FF0a45UjhOj38,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.339.dist-info/METADATA,sha256=KPCpsa_GRv3qJBZ5z71V-yVpZOTq83vKj_8AQVH5Cc8,794
415
- radboy-0.0.339.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
- radboy-0.0.339.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
- radboy-0.0.339.dist-info/RECORD,,
414
+ radboy-0.0.340.dist-info/METADATA,sha256=XKOevnd7GxC4Pc3ONBq76tU5OJmRfKDu5aTaNJTu6GU,794
415
+ radboy-0.0.340.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
416
+ radboy-0.0.340.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
417
+ radboy-0.0.340.dist-info/RECORD,,