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

radboy/DB/CoinCombo.py CHANGED
@@ -90,7 +90,7 @@ class CoinComboUtil:
90
90
  for num,i in enumerate(session.query(CoinCombo4TTL).all()):
91
91
  print(self.colorize(num,ct,i))
92
92
 
93
- def range_generate(self):
93
+ def range_generate(self,forwards=True):
94
94
  bottom=Prompt.__init2__(None,FormBuilderMkText,ptext="Range Min?",helpText="a value",data="float")
95
95
  if bottom in [None,]:
96
96
  return
@@ -112,9 +112,9 @@ class CoinComboUtil:
112
112
  for num,amount in enumerate(rng):
113
113
  amount=round(float(amount),2)
114
114
  print(f"{self.colorize(num,ct,amount)}")
115
- self.generate(amount=amount)
115
+ self.generate(amount=amount,forwards=forwards)
116
116
 
117
- def generate(self,amount=None):
117
+ def generate(self,amount=None,forwards=True):
118
118
  if amount == None or amount < 0:
119
119
  amount = Prompt.__init2__(None,FormBuilderMkText,ptext="How much?",helpText="a value",data="float")
120
120
  if amount in [None,'d']:
@@ -130,7 +130,7 @@ class CoinComboUtil:
130
130
  for i in currencies:
131
131
  bills.append(i.Value)
132
132
  bills=sorted(bills)
133
- combinations = get_bill_combinations(amount, bills)
133
+ combinations = get_bill_combinations(amount, bills,forwards=forwards)
134
134
 
135
135
  # Print the combinations
136
136
  for num,combo in enumerate(combinations):
@@ -180,7 +180,12 @@ class CoinComboUtil:
180
180
 
181
181
  try:
182
182
  if amount == finalmsg[k]['Calculated Total']:
183
- coinCombo=CoinCombo4TTL(Calculated_Total=finalmsg[k]['Calculated Total'],TTL=finalmsg[k]['User Provided Amount'],DTOE=NOW,CurrencyName=finalmsg[k]['Name'],CurrencyValue=finalmsg[k]['Value'],CurrencyNeeded4TTL=finalmsg[k]['NeededQty'],group_id=f"{combo}={finalmsg[k]['User Provided Amount']}")
183
+ gid=f"{combo}={finalmsg[k]['User Provided Amount']}"
184
+ coinCombo=CoinCombo4TTL(Calculated_Total=finalmsg[k]['Calculated Total'],TTL=finalmsg[k]['User Provided Amount'],DTOE=NOW,CurrencyName=finalmsg[k]['Name'],CurrencyValue=finalmsg[k]['Value'],CurrencyNeeded4TTL=finalmsg[k]['NeededQty'],group_id=gid)
185
+ check=session.query(CoinCombo4TTL).filter(CoinCombo4TTL.group_id==gid).first()
186
+ if check:
187
+ print(self.colorize(0,0,f"User Provided Amount({Fore.light_yellow}{amount}{Fore.cyan}) as group_id({Fore.orange_red_1}{gid}{Fore.cyan}) was Located In Storage -> {Fore.light_red}Refusing to Store!{Fore.cyan}"))
188
+ continue
184
189
  session.add(coinCombo)
185
190
  if (num%self.commit_rate)==0:
186
191
  try:
@@ -221,6 +226,11 @@ class CoinComboUtil:
221
226
  'exec':self.generate,
222
227
  'desc':"Generate Coin Combos for a given amount",
223
228
  },
229
+ f'{uuid.uuid1()}':{
230
+ 'cmds':['genr','generate combos reversed','gccr'],
231
+ 'exec':lambda self=self:self.generate(forwards=False),
232
+ 'desc':"Generate Coin Combos for a given amount in reverse",
233
+ },
224
234
  f'{uuid.uuid1()}':{
225
235
  'cmds':['scr','set commit rate','st cmt rt'],
226
236
  'exec':self.setCommitRate,
@@ -236,6 +246,11 @@ class CoinComboUtil:
236
246
  'exec':self.range_generate,
237
247
  'desc':"generate combinations for a range of values [will take a while]",
238
248
  },
249
+ f'{uuid.uuid1()}':{
250
+ 'cmds':['range generate reverse','gen rng rvs','gen range rvs','generate range reverse',',gnrngr','gn rng r',],
251
+ 'exec':self.range_generate,
252
+ 'desc':"generate combinations for a range of values [will take a while] in the reverse direction",
253
+ },
239
254
  f'{uuid.uuid1()}':{
240
255
  'cmds':['skc','scl','seek combo','sk c','search combos',],
241
256
  'exec':self.seek,
radboy/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION='0.0.327'
1
+ VERSION='0.0.329'
Binary file
radboy/whatIs15.py CHANGED
@@ -1,8 +1,9 @@
1
1
  from itertools import combinations_with_replacement
2
2
  from datetime import datetime
3
3
  import sys,os
4
+ import math
4
5
 
5
- def get_bill_combinations(amount, denominations):
6
+ def get_bill_combinations(amount, denominations,forwards=True):
6
7
  """
7
8
  Generates all possible bill combinations for a given amount using specified denominations.
8
9
 
@@ -20,27 +21,34 @@ def get_bill_combinations(amount, denominations):
20
21
  return []
21
22
 
22
23
  amount_cents = int(amount * 100)
23
- denominations_cents = [int(d * 100) for d in denominations]
24
+ #remove denominations not used 20$ cannot be made into a required amount of 1$, smaller denominations are needed
25
+ if forwards:
26
+ denominations_cents = list(reversed([int(d * 100) for d in denominations if amount >= d]))
27
+ else:
28
+ denominations_cents = [int(d * 100) for d in denominations if amount >= d]
24
29
 
25
30
  valid_combinations = []
26
31
  counter=0
27
32
  for r in range(0, amount_cents // min(denominations_cents) + 1):
28
- last=os.get_terminal_size().columns
29
- for combination_tuple in combinations_with_replacement(denominations_cents, r):
30
-
31
- if counter%100000==0:
32
- msg=f"{'\b'*last}"+f"Processing {counter}"
33
- #last=len(msg)
34
- sys.stdout.write(msg)
35
- sys.stdout.flush()
36
- counter+=1
37
- if sum(combination_tuple) == amount_cents:
38
- #valid_combinations.append()
39
- '''
40
- msg=f"{'\b'*last}processing... {datetime.now().ctime()}"
41
- last=len(msg)
42
- sys.stdout.write(msg)
43
- sys.stdout.flush()
44
- '''
45
- yield tuple(x / 100 for x in combination_tuple)
33
+ last=os.get_terminal_size().columns
34
+ try:
35
+ ct=math.comb(len(denominations_cents) + r - 1, r)*100
36
+ except Exception as e:
37
+ ct='MATH ERROR'
38
+ for combination_tuple in combinations_with_replacement(denominations_cents, r):
39
+ if counter%100000==0:
40
+ msg=f"{'\b'*last}"+f"Processing {counter} of {ct} using {[i/100 for i in denominations_cents]}"
41
+ #last=len(msg)
42
+ sys.stdout.write(msg)
43
+ sys.stdout.flush()
44
+ counter+=1
45
+ if sum(combination_tuple) == amount_cents:
46
+ #valid_combinations.append()
47
+ '''
48
+ msg=f"{'\b'*last}processing... {datetime.now().ctime()}"
49
+ last=len(msg)
50
+ sys.stdout.write(msg)
51
+ sys.stdout.flush()
52
+ '''
53
+ yield tuple(x / 100 for x in combination_tuple)
46
54
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radboy
3
- Version: 0.0.327
3
+ Version: 0.0.329
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=4dQsN0k5q6zRhdpZ2Iplblvq9qV8CBXcLPU-58EgYTM,17
8
+ radboy/__init__.py,sha256=F4QfUwD5V4FPF9T8oCZJoA2jLx_mP-J2cM0GtO1XWh0,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
@@ -23,7 +23,7 @@ radboy/renderQR.py.README,sha256=Fimj2dBZzrfHdyBBhcoeF8QqPZt56oGj2hQINk7L9bM,718
23
23
  radboy/t.py,sha256=YYEnpSOnRmyheHVGS6eFXqUgPp_BQC2sr-VCrJzqdEY,301
24
24
  radboy/te.py,sha256=QubC9KtvQCTyXwPT8vs8WIGRqju_VulB0wKh3nqY-Jo,146
25
25
  radboy/version.txt,sha256=hyLxMzF4V83v2rKb5d0pn5gGrkJj8H2hGPZlh1vbu0Y,7
26
- radboy/whatIs15.py,sha256=9Hotdh9Liqy-8GdV7Wb1kiXR4a8hTG1HcfzYGQrYDcA,1632
26
+ radboy/whatIs15.py,sha256=4EYrzHJLcO5Pw_wel54gVyzIeaXkVjijOdZ9aYK1Q20,2166
27
27
  radboy/x.py,sha256=NtnvRFocHgtjDbRsYs69klfIFV7TnxV8oo3PEMmwqrQ,1042
28
28
  radboy/AlcoholConsumption/__init__.py,sha256=OSncIX-anAMHR4Ppls6hSkisYdYvSvkTHc3QXArPNNI,834
29
29
  radboy/AlcoholConsumption/ac.py,sha256=1988xxPpzs41Q7uW4FEOra-Z2ATCHrSEbS8zO7vLT-8,18849
@@ -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/DB/CoinCombo.py,sha256=tSHWmLlQxuTOR1dEx7izWxifJSB6k7uSRAeS9jNB_rk,12388
78
+ radboy/DB/CoinCombo.py,sha256=6gwF0cLUVjUfF_KfD_fhAc6xpvN_tkrhXyxguB4vOOE,13541
79
79
  radboy/DB/DatePicker.py,sha256=2XenrewM6oXcNcBmmwnET2gSYsKJl9QoP-lrEgYIINw,16396
80
80
  radboy/DB/DisplayItemDb.py,sha256=uVvrNyFyBuKvrw-BEPXKYvfa-QWyFN5ahESi2l6vUUA,52046
81
81
  radboy/DB/EstimatedPayCalendarWorkSheet.txt,sha256=GOjRSmGxFoNTdAnpPe2kGv7CkXDrh0Mee01HslamGbo,17173
@@ -383,7 +383,7 @@ radboy/__pycache__/Run.cpython-311.pyc,sha256=G_UEfMtkLRjR6ZpGA_BJzGenuaCcP469Y9
383
383
  radboy/__pycache__/Run.cpython-312.pyc,sha256=v4xolc3mHyla991XhpYBUbBHYT0bnJ1gE-lkFoQ4GFA,241
384
384
  radboy/__pycache__/__init__.cpython-311.pyc,sha256=R-DVbUioMOW-Fnaq7FpT5F1a5p0q3b_RW-HpLRArCAY,242
385
385
  radboy/__pycache__/__init__.cpython-312.pyc,sha256=FsFzLXOlTK8_7ixoPZzakkR8Wibt-DvXLFh-oG2QlPw,164
386
- radboy/__pycache__/__init__.cpython-313.pyc,sha256=8MlMJ78d4yEDidbbZ6-dNOy50pqzHH15s9t38uIDpMY,165
386
+ radboy/__pycache__/__init__.cpython-313.pyc,sha256=ahP1SbWIuRubrd8wUCkOvhrTqvSqTEXBD-P0MIrM_yk,165
387
387
  radboy/__pycache__/__init__.cpython-39.pyc,sha256=D48T6x6FUeKPfubo0sdS_ZUut3FmBvPMP7qT6rYBZzU,275
388
388
  radboy/__pycache__/possibleCode.cpython-311.pyc,sha256=zFiHyzqD8gUnIWu4vtyMYIBposiRQqaRXfcT_fOl4rU,20882
389
389
  radboy/__pycache__/possibleCode.cpython-312.pyc,sha256=tk_CO-AcsO3YZj5j6vEsw3g37UmEzWc5YgeWEoJEUg4,27922
@@ -408,7 +408,7 @@ radboy/tkGui/Images/__pycache__/__init__.cpython-311.pyc,sha256=tXBYpqbOlZ24B1BI
408
408
  radboy/tkGui/__pycache__/BeginnersLuck.cpython-311.pyc,sha256=xLQOnV1wuqHGaub16mPX0dDMGU9ryCeLtNz5e517_GE,3004
409
409
  radboy/tkGui/__pycache__/Review.cpython-311.pyc,sha256=wKq24iM6Xe2OampgZ7-8U6Nvmgs2y-qWOrGwtWhc75k,4047
410
410
  radboy/tkGui/__pycache__/__init__.cpython-311.pyc,sha256=BX7DBn5qbvKTvlrKOP5gzTBPBTeTgSMjBW6EMl7N8e0,230
411
- radboy-0.0.327.dist-info/METADATA,sha256=4IU0YpmqRoLuLAwDwQgOAwY1Tkb02HpCzImZKH-ON9Y,794
412
- radboy-0.0.327.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
413
- radboy-0.0.327.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
414
- radboy-0.0.327.dist-info/RECORD,,
411
+ radboy-0.0.329.dist-info/METADATA,sha256=8HWHkaShd9eNxpkCqcwEXdQF4xccjPleC5x67fI6-ic,794
412
+ radboy-0.0.329.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
413
+ radboy-0.0.329.dist-info/top_level.txt,sha256=mlM0RWMUxGo1YHnlLmYrHOgGdK4XNRpr7nMFD5lR56c,7
414
+ radboy-0.0.329.dist-info/RECORD,,