kisspy-python 1.1.0__tar.gz → 1.2.0__tar.gz

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.
Files changed (41) hide show
  1. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/PKG-INFO +1 -1
  2. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/changes.md +4 -0
  3. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/_metadata.json +1 -1
  4. kisspy_python-1.2.0/kisspy/decorators/methodParameters.py +97 -0
  5. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy_python.egg-info/PKG-INFO +1 -1
  6. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy_python.egg-info/SOURCES.txt +1 -0
  7. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/MANIFEST.in +0 -0
  8. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/__init__.py +0 -0
  9. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/converters/__init__.py +0 -0
  10. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/converters/excelHelpers.py +0 -0
  11. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/converters/numericConverter.py +0 -0
  12. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/decorators/__init__.py +0 -0
  13. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/decorators/pidFile.py +0 -0
  14. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/decorators/singleton.py +0 -0
  15. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/decorators/thrdSafeSync.py +0 -0
  16. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/exceptions.py +0 -0
  17. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/metaclasses/__init__.py +0 -0
  18. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/metaclasses/singleton.py +0 -0
  19. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/__init__.py +0 -0
  20. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/dicts.py +0 -0
  21. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/dt/__init__.py +0 -0
  22. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/dt/timeFormatting.py +0 -0
  23. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/json.py +0 -0
  24. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/lists.py +0 -0
  25. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/paths/__init__.py +0 -0
  26. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/paths/_common.py +0 -0
  27. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/paths/directories.py +0 -0
  28. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/paths/files.py +0 -0
  29. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/strings/__init__.py +0 -0
  30. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/strings/base64data.py +0 -0
  31. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/strings/textExtensions.py +0 -0
  32. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy/xtdPy/strings/textNormalizer.py +0 -0
  33. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy_python.egg-info/dependency_links.txt +0 -0
  34. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy_python.egg-info/requires.txt +0 -0
  35. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/kisspy_python.egg-info/top_level.txt +0 -0
  36. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/license.md +0 -0
  37. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/pyproject.toml +0 -0
  38. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/readme.md +0 -0
  39. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/requirements/prod.txt +0 -0
  40. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/setup.cfg +0 -0
  41. {kisspy_python-1.1.0 → kisspy_python-1.2.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kisspy-python
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Simple Python Scripting Helpers
5
5
  Home-page: https://github.com/joemarchionna/kisspy
6
6
  Author: Joe Marchionna
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
  ## [Unreleased]
8
8
  none
9
9
 
10
+ ## [1.2.0] - 2026 05 07
11
+ ### Added
12
+ - methodParameter decorators
13
+
10
14
  ## [1.1.0] - 2026 04 07
11
15
  ### Changed
12
16
  - Doc Strings
@@ -1,7 +1,7 @@
1
1
 
2
2
  {
3
3
  "name": "kisspy-python",
4
- "version": "1.1.0",
4
+ "version": "1.2.0",
5
5
  "author": "Joe Marchionna",
6
6
  "author_email": "joemarchionna@gmail.com",
7
7
  "description": "Simple Python Scripting Helpers",
@@ -0,0 +1,97 @@
1
+ import functools
2
+ import inspect
3
+
4
+
5
+ def _raiseValueErrorIfErrors(errors: list[str], frmt: str):
6
+ if not errors:
7
+ return
8
+ raise ValueError(frmt.format(", ".join(errors)))
9
+
10
+
11
+ def parametersNotNone(paramNames: list[str]):
12
+ """
13
+ validates that the parameters that are listed are not literally 'None'
14
+
15
+ Args:
16
+ paramNames (list[str]): the decorated function parameter names to validate
17
+
18
+ Raises:
19
+ ValueError
20
+ """
21
+
22
+ def decorator(func):
23
+ @functools.wraps(func)
24
+ def wrapper(*args, **kwargs):
25
+ sig = inspect.signature(func)
26
+ bound = sig.bind(*args, **kwargs)
27
+ bound.apply_defaults()
28
+ errors = []
29
+ for pn in paramNames:
30
+ if pn in bound.arguments:
31
+ val = bound.arguments[pn]
32
+ if val is None:
33
+ errors.append(pn)
34
+ _raiseValueErrorIfErrors(errors, "Parameter(s) '{}' Cannot Be 'None'")
35
+ return func(*bound.args, **bound.kwargs)
36
+
37
+ return wrapper
38
+
39
+ return decorator
40
+
41
+
42
+ def parametersHaveTruthyValue(paramNames: list[str]):
43
+ """
44
+ validates that the parameters that are listed all have 'truthy' values
45
+
46
+ Args:
47
+ paramNames (list[str]): the decorated function parameter names to validate
48
+
49
+ Raises:
50
+ ValueError
51
+ """
52
+
53
+ def decorator(func):
54
+ @functools.wraps(func)
55
+ def wrapper(*args, **kwargs):
56
+ sig = inspect.signature(func)
57
+ bound = sig.bind(*args, **kwargs)
58
+ bound.apply_defaults()
59
+ errors = []
60
+ for pn in paramNames:
61
+ if pn in bound.arguments:
62
+ val = bound.arguments[pn]
63
+ if not val:
64
+ errors.append(pn)
65
+ _raiseValueErrorIfErrors(errors, "Parameter(s) '{}' Are Not A Truthy Value")
66
+ return func(*bound.args, **bound.kwargs)
67
+
68
+ return wrapper
69
+
70
+ return decorator
71
+
72
+
73
+ def parameterLimit(paramName: str, lo: float | int, hi: float | int):
74
+ """
75
+ validates that the listed parameter's value is within the hi and lo value specified
76
+ and corrects the value keeping it within the range specified
77
+
78
+ Args:
79
+ paramName (str): the decorated function parameter name to validate
80
+ lo (float | int): lower value limit
81
+ hi (float | int): upper value limit
82
+ """
83
+
84
+ def decorator(func):
85
+ @functools.wraps(func)
86
+ def wrapper(*args, **kwargs):
87
+ sig = inspect.signature(func)
88
+ bound = sig.bind(*args, **kwargs)
89
+ bound.apply_defaults()
90
+ if paramName in bound.arguments:
91
+ val = bound.arguments[paramName]
92
+ bound.arguments[paramName] = max(lo, min(hi, val))
93
+ return func(*bound.args, **bound.kwargs)
94
+
95
+ return wrapper
96
+
97
+ return decorator
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kisspy-python
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Simple Python Scripting Helpers
5
5
  Home-page: https://github.com/joemarchionna/kisspy
6
6
  Author: Joe Marchionna
@@ -11,6 +11,7 @@ kisspy/converters/__init__.py
11
11
  kisspy/converters/excelHelpers.py
12
12
  kisspy/converters/numericConverter.py
13
13
  kisspy/decorators/__init__.py
14
+ kisspy/decorators/methodParameters.py
14
15
  kisspy/decorators/pidFile.py
15
16
  kisspy/decorators/singleton.py
16
17
  kisspy/decorators/thrdSafeSync.py
File without changes
File without changes
File without changes
File without changes
File without changes