libs5-python 1.0.12__py3-none-any.whl → 1.0.14__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,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: libs5-python
3
- Version: 1.0.12
3
+ Version: 1.0.14
4
4
  Summary: libs5 python scripts, and helper classes (useg e.g. in BEANS software)
5
5
  Project-URL: Homepage, https://gitlab.com/ahypki/libs5-python
6
6
  Project-URL: Issues, https://gitlab.com/ahypki/libs5-python/-/issues/
@@ -1,23 +1,23 @@
1
1
  net/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  net/hypki/File.py,sha256=2sKAqRBFmKsRL1Isqmj78rbD41MD3-QGgTB2iz5hcoc,1340
3
3
  net/hypki/Ini.py,sha256=5o8INPYga1uk3O8V27exF6XaluaDayDiD0JkCgTUrj0,5730
4
- net/hypki/Logger.py,sha256=A50xDy9Qj_BxaCxMgwBNWTsiyBUoDZ4_ovhEXxJQdQM,1817
5
- net/hypki/StringUtils.py,sha256=UuUnPIlkIe0WzUo-Q0o8HmE0kQP6MJwNZzK2fm39J-Y,438
4
+ net/hypki/Logger.py,sha256=dORtSpFuWL0sjht4dKvc3MPe_XJrVY8-SFh72RWoN0Y,1821
5
+ net/hypki/StringUtils.py,sha256=1WRhsUlGrY2iL8rYSGXBOvaQIQX3EnWGQvYxRgUofQE,1143
6
6
  net/hypki/UserIO.py,sha256=cQeH8xjSzCI32l17pWXBBzAcA7lXByPt3NAFEvEWCMU,304
7
7
  net/hypki/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  net/hypki/apiutils.py,sha256=E_0EKQ46BbdTHqVABky8DqIe1WetpglmsPWgnjUGeJQ,1036
9
- net/hypki/args.py,sha256=9ReREpwAPFoGyBY-L5XqoVWjfS8OQJSHZVYV8VEAK7c,975
9
+ net/hypki/args.py,sha256=yC5OIMLmOQra5S_ChugzXfb4iulQbC6CtQ9m_xp0uZI,1184
10
10
  net/hypki/asserts.py,sha256=awT2uysmbsPFpOBf6vaS0r39QBvsI5QGrwreXk0bwhE,198
11
11
  net/hypki/io.py,sha256=H1ImSJojFbVa8Ww1iQ1Nr-sIjz_hEM0HkhMmSkFZEzo,1878
12
12
  net/hypki/log.py,sha256=Qlbm1nZVBgs7EXF3Y12upGOU5Mpg0tL5YhJ3e6HGthQ,1730
13
13
  net/hypki/math.py,sha256=-ZcIvUcSD5VTtPer6chvrARjL4BKEGqwsgnmAyfld4Q,197
14
- net/hypki/random.py,sha256=svaPZV2B5DQj_GToIX49pOKxbgdKYY8hmu743Gyvw_c,231
15
- net/hypki/regex.py,sha256=t80iy6fXiiQOYB1FIjpgpfrLdG2QOwKtRgnrCAn-9Ws,934
14
+ net/hypki/random.py,sha256=CQC5bDdmH9ik9d60KhNpxaoi9C7TwNOgQOghJasXG7M,542
15
+ net/hypki/regex.py,sha256=-_Eu1ccnGD7r-ikMQh8lQe39VFvFM-qCFFqq7FMlxJU,942
16
16
  net/hypki/system.py,sha256=9MOAIJ221BH4GR4KKpPXexJGmFaWGZ1_wgi49kaFpmE,558
17
17
  net/hypki/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  net/hypki/tests/kepler.py,sha256=3mEdHecMvM_ztUO17ZVvhxIXTze12-xx71A6Y3iaf_M,2307
19
19
  net/hypki/tests/numpytest.py,sha256=FAyGjE2u_rqcoXUtj8HP4VbWP2f_LhOJ3hYVp37tDsA,378
20
- libs5_python-1.0.12.dist-info/METADATA,sha256=ZgfLlBDYfwyat5omCo6ENrAeYymvfRjShwpcOQsjXqk,1258
21
- libs5_python-1.0.12.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
22
- libs5_python-1.0.12.dist-info/licenses/LICENSE,sha256=jUGenC6Eo6P1BkABG3AQ2ThWGSDHgxa58dRIB8iR8Pc,1072
23
- libs5_python-1.0.12.dist-info/RECORD,,
20
+ libs5_python-1.0.14.dist-info/METADATA,sha256=HcF41XCgDkBYDdRwQW3Kf4O237sHPIc2xKQgYNaTLsI,1258
21
+ libs5_python-1.0.14.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
22
+ libs5_python-1.0.14.dist-info/licenses/LICENSE,sha256=jUGenC6Eo6P1BkABG3AQ2ThWGSDHgxa58dRIB8iR8Pc,1072
23
+ libs5_python-1.0.14.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.28.0
2
+ Generator: hatchling 1.33.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
net/hypki/Logger.py CHANGED
@@ -3,9 +3,9 @@ Created on Aug 13, 2025
3
3
 
4
4
  @author: ahypki
5
5
  '''
6
- from rich.console import Console
6
+ # from rich.console import Console
7
7
 
8
- console = Console()
8
+ # console = Console()
9
9
 
10
10
  class Logger:
11
11
  BLUE = '[blue]'#'\033[94m'
net/hypki/StringUtils.py CHANGED
@@ -3,6 +3,7 @@ Created on Oct 14, 2025
3
3
 
4
4
  @author: ahypki
5
5
  '''
6
+ import json
6
7
 
7
8
  class StringUtils(object):
8
9
  '''
@@ -20,4 +21,27 @@ class StringUtils(object):
20
21
  return not StringUtils.isEmpty(s) #len(s.strip()) > 0 if s is not None else False
21
22
 
22
23
  def isEmpty(s): # @NoSelf
23
- return s is None or len(s.strip()) == 0 if s is not None else False
24
+ if s is None:
25
+ return True
26
+ if len(s.strip()) == 0:
27
+ return True
28
+ else:
29
+ return False
30
+
31
+ def jsonPretty(json_thing, sort=True, indents=4): # @NoSelf
32
+ if type(json_thing) is str:
33
+ return json.dumps(json.loads(json_thing), sort_keys=sort, indent=indents)
34
+ else:
35
+ return json.dumps(json_thing, sort_keys=sort, indent=indents)
36
+
37
+ def replace(s, what, withWhat): # @NoSelf
38
+ return s.replace(what, withWhat)
39
+
40
+ def replaceInf(s, what, withWhat): # @NoSelf
41
+ i = 0
42
+ while True:
43
+ sprim = s.replace(what, withWhat)
44
+ if len(sprim) == len(s) or i > 1000:
45
+ break;
46
+ i += 1
47
+ return sprim
net/hypki/args.py CHANGED
@@ -32,4 +32,11 @@ class ArgUtils:
32
32
  return len(sys.argv)
33
33
 
34
34
  def getArg(idx): # @NoSelf
35
- return sys.argv[idx]
35
+ return sys.argv[idx]
36
+
37
+ def getArgNames(): # @NoSelf
38
+ names = []
39
+ for i in range(len(sys.argv)):
40
+ if sys.argv[i].startswith("--"):
41
+ names.append(sys.argv[i][2:])
42
+ return names
net/hypki/random.py CHANGED
@@ -7,6 +7,18 @@ Created on 18-07-2013
7
7
  import os
8
8
  import uuid
9
9
  import base64
10
+ import random
11
+
12
+ class RandomUtils:
13
+
14
+ def nextDouble(max = None): # @NoSelf
15
+ if max is not None:
16
+ return random.random() * max
17
+ else:
18
+ return random.random()
19
+
20
+ def nextInt(minInt = 0, maxInt = 1): # @NoSelf
21
+ return random.randint(minInt, maxInt)
10
22
 
11
23
  def nextUuid():
12
24
  return str(uuid.uuid4())
net/hypki/regex.py CHANGED
@@ -30,10 +30,10 @@ def allGroups(s, regex):
30
30
  return ""
31
31
 
32
32
  def isLong(strNumber):
33
- return matches(strNumber, "^[\d]+$")
33
+ return matches(strNumber, "^[\\d]+$")
34
34
 
35
35
  def isDouble(strNumber):
36
- return matches(strNumber, "[\d]+\.[\d\+\-eE]+")
36
+ return matches(strNumber, "^[\\d]+\\.[\\d\\+\\-eE]+$")
37
37
 
38
38
  def matches(s, regex):
39
39
  r = re.compile(regex)