rdxz2-utill 0.0.2__py3-none-any.whl → 0.0.4__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 rdxz2-utill might be problematic. Click here for more details.
- {rdxz2_utill-0.0.2.dist-info → rdxz2_utill-0.0.4.dist-info}/METADATA +1 -1
- {rdxz2_utill-0.0.2.dist-info → rdxz2_utill-0.0.4.dist-info}/RECORD +13 -12
- {rdxz2_utill-0.0.2.dist-info → rdxz2_utill-0.0.4.dist-info}/WHEEL +1 -1
- utill/my_bq.py +1 -3
- utill/my_compare.py +34 -0
- utill/my_csv.py +1 -0
- utill/my_gcs.py +2 -0
- utill/my_pg.py +1 -1
- utill/templates/mb.json +2 -1
- utill/templates/pg.json +2 -1
- {rdxz2_utill-0.0.2.dist-info → rdxz2_utill-0.0.4.dist-info}/entry_points.txt +0 -0
- {rdxz2_utill-0.0.2.dist-info → rdxz2_utill-0.0.4.dist-info}/licenses/LICENSE +0 -0
- {rdxz2_utill-0.0.2.dist-info → rdxz2_utill-0.0.4.dist-info}/top_level.txt +0 -0
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
rdxz2_utill-0.0.
|
|
1
|
+
rdxz2_utill-0.0.4.dist-info/licenses/LICENSE,sha256=PF9CUvzP8XFYopEAzrMzSCovF7RdBdscPqJCDC6KjPc,1073
|
|
2
2
|
utill/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
utill/my_bq.py,sha256=
|
|
3
|
+
utill/my_bq.py,sha256=o3foe_sbYKJ_lfiW4e6oPfNIUIxyKmsrwa6TbYF5bDA,14611
|
|
4
|
+
utill/my_compare.py,sha256=oGK4fEAQYZqy2FH-jqRSvxANL9SsEoEaq5GOCMGoNXI,918
|
|
4
5
|
utill/my_const.py,sha256=88dOqn6NPQ5-hfRqdkew5POoAIyO91XXOGvN76oNsdo,251
|
|
5
|
-
utill/my_csv.py,sha256=
|
|
6
|
+
utill/my_csv.py,sha256=svgu93R0pP7UW0B58eJMi0vuJnYhqMtafzCsTIk4yUU,2781
|
|
6
7
|
utill/my_datetime.py,sha256=KEZTplLk3tgVqqC3wClXFcsF_zo40fma_rtPg4kSJHc,2125
|
|
7
8
|
utill/my_dict.py,sha256=jPaPfdn4WYpm0uIBPiYFinpHhx1jXpFVDJ9npmvxGZQ,391
|
|
8
9
|
utill/my_encryption.py,sha256=SCF7PPur39cW4RHidsRhw-9BZP-ymUH-6LZ9nAHJDsY,2105
|
|
9
10
|
utill/my_env.py,sha256=mREys72Ybg2p9p2s7ApOt0s_6F5-qxR8FyYEcSJ8pmU,2093
|
|
10
11
|
utill/my_file.py,sha256=H3QmIOwubQCUMoOuk7jwf6AnqsljWZIuM7OjelyZby4,1865
|
|
11
|
-
utill/my_gcs.py,sha256=
|
|
12
|
+
utill/my_gcs.py,sha256=u9rZr4e6XLLFK1QC9JknMwBeNX5MWOnVq1W50U5Jt14,4032
|
|
12
13
|
utill/my_input.py,sha256=OyKLoutXpwISReltuL_Gw2oojv16tYWJqQpqabBOQx4,350
|
|
13
14
|
utill/my_json.py,sha256=WgW6mavGhfs4h1N5XbhsDnRk2dbh_ttJWdJUj4iWDN4,1473
|
|
14
15
|
utill/my_mb.py,sha256=3_A5kXHgnkxGbd38vK5t5MfFcj84lohjS7C2OtlSo30,14841
|
|
15
|
-
utill/my_pg.py,sha256=
|
|
16
|
+
utill/my_pg.py,sha256=udsqNok7dOFz1rO-hQhqnEj8PpH9oMdkyyjGAdLRS-w,6554
|
|
16
17
|
utill/my_queue.py,sha256=hINP4_yjmboSjHgo1J3CtPm2X9SE3HfczyED3ip7nfk,1930
|
|
17
18
|
utill/my_string.py,sha256=pINYFR1ligTyVZYzV8P_FolCsZQwYE1jaFNTuQ3XS_8,833
|
|
18
19
|
utill/my_style.py,sha256=Wy6j4WL9RgGeX6cS9hhlOrufc9UC4UPTQ5UJa0ZJ3Yo,900
|
|
@@ -25,10 +26,10 @@ utill/cmd/_enc.py,sha256=DBy3Iwa5DTtww7lgHPRLEilrYPrWDG1vRv5PO-YzNO8,997
|
|
|
25
26
|
utill/cmd/_main.py,sha256=UJ_XTIGDO9XPIypgHhS81SJQ_8qy8JOyw98Or0Nb2x8,273
|
|
26
27
|
utill/cmd/_pg.py,sha256=RVxEiSifyIwMDYDM69vt6WSLdVDr1cMzY6r4T2PzNRA,492
|
|
27
28
|
utill/cmd/utill.py,sha256=TlHfiwOUcK1m58PrRCjX9sARiPYZUsoTk-KOTCOz1vM,3558
|
|
28
|
-
utill/templates/mb.json,sha256=
|
|
29
|
-
utill/templates/pg.json,sha256=
|
|
30
|
-
rdxz2_utill-0.0.
|
|
31
|
-
rdxz2_utill-0.0.
|
|
32
|
-
rdxz2_utill-0.0.
|
|
33
|
-
rdxz2_utill-0.0.
|
|
34
|
-
rdxz2_utill-0.0.
|
|
29
|
+
utill/templates/mb.json,sha256=M46ZHSaSh4rbD_KGUViGr2B2ZV8_PC-O5Evqi35JK5g,59
|
|
30
|
+
utill/templates/pg.json,sha256=LkJt0VV3zcyt7Tpn6gulsoVQgUc-9uImXOStvzu8cdU,271
|
|
31
|
+
rdxz2_utill-0.0.4.dist-info/METADATA,sha256=nZ2GUHgCjt5YG-zsuFN8SJzh7oF35MPdFRqtHTkhT5s,4489
|
|
32
|
+
rdxz2_utill-0.0.4.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
33
|
+
rdxz2_utill-0.0.4.dist-info/entry_points.txt,sha256=9n5NWz5Wi9jDvYhB_81_4icgT5xABZ-QivHD8ibcafg,47
|
|
34
|
+
rdxz2_utill-0.0.4.dist-info/top_level.txt,sha256=tuAYZoCsr02JYbpZj7I6fl1IIo53v3GG0uoj-_fINVk,6
|
|
35
|
+
rdxz2_utill-0.0.4.dist-info/RECORD,,
|
utill/my_bq.py
CHANGED
|
@@ -12,7 +12,6 @@ from .my_const import ByteSize
|
|
|
12
12
|
from .my_csv import read_header, combine as csv_combine, compress
|
|
13
13
|
from .my_datetime import current_datetime_str
|
|
14
14
|
from .my_env import envs
|
|
15
|
-
from .my_file import make_sure_path_is_directory
|
|
16
15
|
from .my_gcs import GCS
|
|
17
16
|
from .my_queue import ThreadingQ
|
|
18
17
|
from .my_string import replace_nonnumeric
|
|
@@ -249,8 +248,7 @@ class BQ():
|
|
|
249
248
|
if not dst_filename.endswith('.csv'):
|
|
250
249
|
raise ValueError('Destination filename must ends with .csv!')
|
|
251
250
|
|
|
252
|
-
dirname =
|
|
253
|
-
make_sure_path_is_directory(dirname)
|
|
251
|
+
dirname = dst_filename.removesuffix('.csv')
|
|
254
252
|
|
|
255
253
|
# Remove & recreate existing folder
|
|
256
254
|
if os.path.exists(dirname):
|
utill/my_compare.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import math
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def try_float(value) -> float:
|
|
5
|
+
try:
|
|
6
|
+
return float(value)
|
|
7
|
+
except:
|
|
8
|
+
return value
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def same(a, b, float_precision=None) -> tuple[bool, float]:
|
|
12
|
+
if a is None and b is None:
|
|
13
|
+
return True, None
|
|
14
|
+
|
|
15
|
+
if a is None or b is None:
|
|
16
|
+
return False, None
|
|
17
|
+
|
|
18
|
+
# Compare float
|
|
19
|
+
a_float = try_float(a)
|
|
20
|
+
b_float = try_float(b)
|
|
21
|
+
if isinstance(a_float, float) or isinstance(b_float, float):
|
|
22
|
+
try:
|
|
23
|
+
if math.isnan(a_float) and math.isnan(b_float):
|
|
24
|
+
return True, None
|
|
25
|
+
|
|
26
|
+
if float_precision:
|
|
27
|
+
a_float_rounded = round(a_float, float_precision)
|
|
28
|
+
b_float_rounded = round(b_float, float_precision)
|
|
29
|
+
|
|
30
|
+
return a_float_rounded == b_float_rounded, abs(a_float - b_float)
|
|
31
|
+
except (ValueError, TypeError):
|
|
32
|
+
raise Exception(f'Can\'t compare {a} to {b}')
|
|
33
|
+
|
|
34
|
+
return str(a) == str(b), None
|
utill/my_csv.py
CHANGED
utill/my_gcs.py
CHANGED
|
@@ -30,6 +30,8 @@ class GCS:
|
|
|
30
30
|
return f'{self.base_path}/{path}' if self.base_path else path
|
|
31
31
|
|
|
32
32
|
def change_bucket(self, bucket_name: str):
|
|
33
|
+
if not bucket_name:
|
|
34
|
+
raise ValueError('Bucket name needed')
|
|
33
35
|
self.bucket = self.client.bucket(bucket_name)
|
|
34
36
|
logger.debug(f'Change bucket to {self.bucket.name}')
|
|
35
37
|
|
utill/my_pg.py
CHANGED
|
@@ -24,7 +24,7 @@ class PG:
|
|
|
24
24
|
) -> None:
|
|
25
25
|
# Evaluate config source
|
|
26
26
|
if isinstance(config_source, str):
|
|
27
|
-
if os.path.exists(config_source):
|
|
27
|
+
if not os.path.exists(config_source):
|
|
28
28
|
raise ValueError(f'Config source file not found: {config_source}, create one with \'utill init\'')
|
|
29
29
|
if connection is None:
|
|
30
30
|
raise ValueError('Connection name must be provided when using file source!')
|
utill/templates/mb.json
CHANGED
utill/templates/pg.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|