zhmiscellany 6.2.4__py3-none-any.whl → 6.2.6__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.
@@ -1,12 +1,7 @@
1
- from ._processing_supportfuncs import batch_multiprocess, multiprocess, synchronous_class_multiprocess, ThreadWithResult
2
- import threading, kthread
3
- import traceback
4
- import zhmiscellany.string
5
- import subprocess, zlib, pickle, dill, tempfile, os, base64
6
- from itertools import chain
7
-
1
+ import threading
8
2
 
9
3
  def start_daemon(**kwargs):
4
+ import threading
10
5
  thread = threading.Thread(**kwargs)
11
6
  thread.daemon = True
12
7
  thread.start()
@@ -15,6 +10,8 @@ def start_daemon(**kwargs):
15
10
 
16
11
  def batch_threading(targets, max_threads=None, show_errors=True, flatten=False):
17
12
  import concurrent.futures
13
+ import traceback
14
+ from itertools import chain
18
15
  def execute_target(target):
19
16
  try: return target[0](*target[1])
20
17
  except Exception:
@@ -35,6 +32,7 @@ def batch_threading(targets, max_threads=None, show_errors=True, flatten=False):
35
32
 
36
33
  def batch_threading_gen(targets, max_threads=None, show_errors=True):
37
34
  import concurrent.futures
35
+ import traceback
38
36
  def execute_target(target):
39
37
  try: return target[0](*target[1])
40
38
  except Exception:
@@ -50,6 +48,9 @@ def batch_threading_gen(targets, max_threads=None, show_errors=True):
50
48
 
51
49
 
52
50
  def batch_multiprocess_threaded(targets_and_args, disable_warning=False, killable=False, daemon=False):
51
+ import kthread
52
+ import threading
53
+ from ._processing_supportfuncs import batch_multiprocess
53
54
  if killable:
54
55
  thread_method = kthread.KThread
55
56
  else:
@@ -66,6 +67,13 @@ def multiprocess_threaded(target, args=(), disable_warning=False, killable=False
66
67
 
67
68
 
68
69
  def raw_multiprocess(func, args=(), fileless=True):
70
+ import zhmiscellany.string
71
+ import subprocess
72
+ import tempfile
73
+ import os
74
+ import zlib
75
+ import pickle
76
+ import dill
69
77
  cap_string = b'|'+bytes(zhmiscellany.string.get_universally_unique_string(), 'u8')+b'|'
70
78
  code = \
71
79
  '''import os, dill, zlib, sys, pickle, traceback, psutil, signal
@@ -159,6 +167,14 @@ if __name__ == "__main__":
159
167
 
160
168
 
161
169
  def raw_continuous_multiprocess(input_class, args=(), fileless=True, cleanup_file=True):
170
+ import zhmiscellany.string
171
+ import subprocess
172
+ import tempfile
173
+ import os
174
+ import zlib
175
+ import pickle
176
+ import dill
177
+ import base64
162
178
  cap_string = b'|' + bytes(zhmiscellany.string.get_universally_unique_string(), 'u8') + b'|'
163
179
  block_header_string = b'|' + bytes(zhmiscellany.string.get_universally_unique_string(), 'u8') + b'|'
164
180
  completion_marker = b'|' + bytes(zhmiscellany.string.get_universally_unique_string(), 'u8') + b'|'
zhmiscellany/rust.py CHANGED
@@ -1,10 +1,12 @@
1
1
  import zhmiscellanyrusteffect
2
- import numpy as np
3
2
 
4
3
  list_files_recursive = zhmiscellanyrusteffect.list_files_recursive
5
4
  def numpy_mean(np_arr):
5
+ import numpy as np
6
6
  return zhmiscellanyrusteffect.np_mean(np_arr.astype(np.float64, copy=False))
7
7
  def numpy_sum(np_arr):
8
+ import numpy as np
8
9
  return zhmiscellanyrusteffect.np_sum(np_arr.astype(np.float64, copy=False))
9
10
  def numpy_median(np_arr):
11
+ import numpy as np
10
12
  return zhmiscellanyrusteffect.np_median(np_arr.astype(np.float64, copy=False))
zhmiscellany/string.py CHANGED
@@ -1,7 +1,5 @@
1
- import string, time, datetime
2
-
3
-
4
1
  def convert_to_base62(number):
2
+ import string
5
3
  number = int(str(number).replace('.', ''))
6
4
  # Base 62 characters: digits (0-9), lowercase letters (a-z), and uppercase letters (A-Z)
7
5
  base62_chars = string.digits + string.ascii_lowercase + string.ascii_uppercase
@@ -17,6 +15,7 @@ def convert_to_base62(number):
17
15
 
18
16
 
19
17
  def get_universally_unique_string():
18
+ import time
20
19
  #number = None
21
20
  #if not number:
22
21
  timestamp = str(time.perf_counter_ns())
@@ -40,6 +39,7 @@ def multi_replace(string, replaces, recursive=False):
40
39
 
41
40
 
42
41
  def timestamp_to_time(unix_timestamp):
42
+ import datetime
43
43
  # Convert the Unix timestamp to a datetime object
44
44
  dt_object = datetime.datetime.fromtimestamp(unix_timestamp)
45
45
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zhmiscellany
3
- Version: 6.2.4
3
+ Version: 6.2.6
4
4
  Summary: A collection of useful/interesting python libraries made by zh.
5
5
  Home-page: https://discord.gg/ThBBAuueVJ
6
6
  Author: zh
@@ -0,0 +1,27 @@
1
+ zhmiscellany/__init__.py,sha256=n18TrUpZfgMfUzNsVvokokHamWXWOCjXJ8XO1XXN6Xk,1147
2
+ zhmiscellany/_discord_supportfuncs.py,sha256=cCvru9zGEeFxn-hqnBeI6fFYoKTWeTQIHvZTHcudfe8,6510
3
+ zhmiscellany/_fileio_supportfuncs.py,sha256=RZxakXD4tb05AXJXgHS4ZI-Lr9A8fY_LcWe2-8EeF9Y,436
4
+ zhmiscellany/_misc_supportfuncs.py,sha256=gprZ1b7PgfSlAppMlHxRQImV-ks4IXFe7LZhbVecLUQ,13839
5
+ zhmiscellany/_processing_supportfuncs.py,sha256=kKP_dChzkci9zleP3nEvEEIz0Jd8DJ3X0Hi3Qah9eK8,11449
6
+ zhmiscellany/_py_resources.py,sha256=eEEvqa-C7jYFrUnKLvemO77_h1-TdzEe_QsLal86P8U,229013
7
+ zhmiscellany/_resource_files_lookup.py,sha256=hsgPW0dngokgqWrAVAv5rUo-eobzJPjvWHt4xrOG5l0,856
8
+ zhmiscellany/cpp.py,sha256=XEUEoIKCDCdY5VgwNWE5oXrGjtsmGdz_MnaVwQmi2dk,179
9
+ zhmiscellany/dict.py,sha256=dNu3G9qiJeLgE7JY3QD31GJU7EfLsYPqxf8AOhBsYag,81
10
+ zhmiscellany/discord.py,sha256=yKoigWI3tONfYSoMEynGGEWW1VsXSRdkg8vPbIKwBNI,20312
11
+ zhmiscellany/fileio.py,sha256=0QZvCXd9fJ3Rart-kk63KMSwIJ3iCoWvUHtdhd-EM0o,20595
12
+ zhmiscellany/gui.py,sha256=OVwuZ_kWHJlgKPeYR7fAAyomNmU-OnxOgXZelVNPm1w,10409
13
+ zhmiscellany/image.py,sha256=6Hz5sfym_o7FHokGUKeXRsjl89VY_ZMSLnvuSam1icI,8265
14
+ zhmiscellany/list.py,sha256=BnbYG-lpHmi0C4v8jLfaeXqQdc3opmNgkvY6yz4pasg,1475
15
+ zhmiscellany/macro.py,sha256=q4Ax7_4vJ5OIVuyRxFoUilEq_5rSF90qCChop2HGetA,27885
16
+ zhmiscellany/math.py,sha256=nNsrg4le3XIt1y36lQv5xNCjUoIu7Q1lV5BdpmyD_wk,2530
17
+ zhmiscellany/misc.py,sha256=0vJFa0MRdKXjLLVeFfMx1Q-b-qrKqpdaq6FzWKz6SMY,32489
18
+ zhmiscellany/netio.py,sha256=rN17uIbsWqDG9ssmouD7VZqOtlgWObaCsvn2Hrq-k6w,2413
19
+ zhmiscellany/pastebin.py,sha256=jstR_HRP9fUVcQXp4D8zkqvA0GLHNrDrfhqb9Sc-dL0,6479
20
+ zhmiscellany/pipes.py,sha256=RlHxsW_M_R6UJUIDgYVS_zfqUwO8kXG8j-0YG5qByjo,4637
21
+ zhmiscellany/processing.py,sha256=qvowgj-cHZBaQsSQcQ51ywjX2Q5qRZQTMz3o5QIVEM4,11290
22
+ zhmiscellany/rust.py,sha256=cHkSpdtq7QQW3yzBEAYL9lZxLW0h4wal2tsxIOnyTrA,494
23
+ zhmiscellany/string.py,sha256=A4ilBWSYlrJ0AJ0axvepSSjYCYwYk5X-vRrHNphi_ow,4809
24
+ zhmiscellany-6.2.6.dist-info/METADATA,sha256=YLSCxihHzeMnvTZJFWZhvz2yQlcwhzLXLMgytpHsvGU,43872
25
+ zhmiscellany-6.2.6.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
26
+ zhmiscellany-6.2.6.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
27
+ zhmiscellany-6.2.6.dist-info/RECORD,,
@@ -1,27 +0,0 @@
1
- zhmiscellany/__init__.py,sha256=Oh3gAJRWq2aUEgkolmQyiZOQ3iey5OC4NA2XaTHuVv4,1139
2
- zhmiscellany/_discord_supportfuncs.py,sha256=RotSpurqFtL5q6v_ST1e2Y_1qJMaHp1CDsF5i-gR4ec,6524
3
- zhmiscellany/_fileio_supportfuncs.py,sha256=soibLv9nOR79sHQ2MGQH2O6MhnqdXqI7ybxHSN2Tfac,434
4
- zhmiscellany/_misc_supportfuncs.py,sha256=vfwcETCBq6fX96jad8aVPnZq5OpvNslgQPATUmGVbuI,9937
5
- zhmiscellany/_processing_supportfuncs.py,sha256=6UfR0QVkWv2MXKuTwWmI4bsn1joEQ-EOYo3v8sFzx_Y,11001
6
- zhmiscellany/_py_resources.py,sha256=HqJs5aRLymLZ2J5Io8g6bY58pGWhN9b8vCktC2DW4KQ,229009
7
- zhmiscellany/_resource_files_lookup.py,sha256=hsgPW0dngokgqWrAVAv5rUo-eobzJPjvWHt4xrOG5l0,856
8
- zhmiscellany/cpp.py,sha256=XEUEoIKCDCdY5VgwNWE5oXrGjtsmGdz_MnaVwQmi2dk,179
9
- zhmiscellany/dict.py,sha256=0BZJ5eK-MurAHYV1OPa0jdGTr-QEWos7ZM0npb-tN9I,81
10
- zhmiscellany/discord.py,sha256=iQfDrYCcoolfpCbE_kQN_yq_oOx4cbdYcTI8iHoKtIE,19756
11
- zhmiscellany/fileio.py,sha256=YqIfdit0TQr4VYmpCftoqwtddqo1OZz6duI7BKg7Dy4,19532
12
- zhmiscellany/gui.py,sha256=BDmM7e5ITKQuzxSzaYvPapQuPbQjCMTOq-GyMcLCIgg,10198
13
- zhmiscellany/image.py,sha256=kl4i5nfFW_byQkuCn_55HK4p1kuqng7L-k0iUbnhFb8,8257
14
- zhmiscellany/list.py,sha256=S8Z85bLJEP9lk2JkGpzUcG6kpRB7a-NWDIHMPiF5bKo,1473
15
- zhmiscellany/macro.py,sha256=kKtKYoHLSnBBHyGl8FlnfMaAoraKKSK023VA-mOezO0,27861
16
- zhmiscellany/math.py,sha256=btOQTe_GvqP0A7Zz84tmN_c8j1NGe_mKnhmAt40lhLU,2482
17
- zhmiscellany/misc.py,sha256=llL3ZHD5pxS4RDKLj3gX0k3NpE2mM5g3JVd0k_RvIUg,31979
18
- zhmiscellany/netio.py,sha256=qwHsQb7TrKaIYmjH0SV-2J6lELth9QsmcsHDupzf5ok,2560
19
- zhmiscellany/pastebin.py,sha256=TbZ3DqFYXo5qt5d95ugrofYoptlzKkjXUr7VnEqa6ks,6357
20
- zhmiscellany/pipes.py,sha256=ESg7UvnUJMfJ4LnNoARayZuhBPKEMGPLv_429ZCNzso,4629
21
- zhmiscellany/processing.py,sha256=FnWPhtzLHFtIkp0ROUVQ9fZWk1IZrSPv7lMIp8VZLnI,11049
22
- zhmiscellany/rust.py,sha256=znN6DYNoa_p-braTuDZKvUnXX8reWLFu_dG4fv2vLR0,442
23
- zhmiscellany/string.py,sha256=xyqE6V5YF2nieZDcg5ZrXTIrH2D9oDRbZ5vQGz8rPys,4787
24
- zhmiscellany-6.2.4.dist-info/METADATA,sha256=JpHQ3pl0C7gqzZtNBnJQaojYzq0OxV5mxKojVLgt5SE,43872
25
- zhmiscellany-6.2.4.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
26
- zhmiscellany-6.2.4.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
27
- zhmiscellany-6.2.4.dist-info/RECORD,,