safeshield 1.0.6__tar.gz → 1.0.8__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.

Potentially problematic release.


This version of safeshield might be problematic. Click here for more details.

Files changed (37) hide show
  1. {safeshield-1.0.6 → safeshield-1.0.8}/PKG-INFO +7 -1
  2. {safeshield-1.0.6 → safeshield-1.0.8}/README.md +6 -0
  3. {safeshield-1.0.6 → safeshield-1.0.8}/safeshield.egg-info/PKG-INFO +7 -1
  4. {safeshield-1.0.6 → safeshield-1.0.8}/setup.py +1 -1
  5. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/__init__.py +0 -1
  6. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/array.py +1 -1
  7. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/base.py +20 -3
  8. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/basic.py +1 -1
  9. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/comparison.py +1 -1
  10. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/conditional.py +1 -1
  11. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/date.py +1 -1
  12. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/files.py +1 -1
  13. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/format.py +1 -1
  14. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/string.py +1 -1
  15. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/type.py +1 -1
  16. {safeshield-1.0.6 → safeshield-1.0.8}/validator/rules/utilities.py +1 -1
  17. safeshield-1.0.8/validator/services/__init__.py +5 -0
  18. safeshield-1.0.6/validator/services/__init__.py +0 -5
  19. {safeshield-1.0.6 → safeshield-1.0.8}/LICENSE +0 -0
  20. {safeshield-1.0.6 → safeshield-1.0.8}/safeshield.egg-info/SOURCES.txt +0 -0
  21. {safeshield-1.0.6 → safeshield-1.0.8}/safeshield.egg-info/dependency_links.txt +0 -0
  22. {safeshield-1.0.6 → safeshield-1.0.8}/safeshield.egg-info/requires.txt +0 -0
  23. {safeshield-1.0.6 → safeshield-1.0.8}/safeshield.egg-info/top_level.txt +0 -0
  24. {safeshield-1.0.6 → safeshield-1.0.8}/setup.cfg +0 -0
  25. {safeshield-1.0.6 → safeshield-1.0.8}/validator/__init__.py +0 -0
  26. {safeshield-1.0.6 → safeshield-1.0.8}/validator/core/__init__.py +0 -0
  27. {safeshield-1.0.6 → safeshield-1.0.8}/validator/core/validator.py +0 -0
  28. {safeshield-1.0.6 → safeshield-1.0.8}/validator/database/__init__.py +0 -0
  29. {safeshield-1.0.6 → safeshield-1.0.8}/validator/database/detector.py +0 -0
  30. {safeshield-1.0.6 → safeshield-1.0.8}/validator/database/manager.py +0 -0
  31. {safeshield-1.0.6 → safeshield-1.0.8}/validator/exceptions.py +0 -0
  32. {safeshield-1.0.6 → safeshield-1.0.8}/validator/factory.py +0 -0
  33. {safeshield-1.0.6 → safeshield-1.0.8}/validator/services/rule_conflict.py +0 -0
  34. {safeshield-1.0.6 → safeshield-1.0.8}/validator/services/rule_error_handler.py +0 -0
  35. {safeshield-1.0.6 → safeshield-1.0.8}/validator/services/rule_preparer.py +0 -0
  36. {safeshield-1.0.6 → safeshield-1.0.8}/validator/utils/__init__.py +0 -0
  37. {safeshield-1.0.6 → safeshield-1.0.8}/validator/utils/string.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: safeshield
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: Library for Help Validation Control
5
5
  Home-page: https://github.com/WunsunTarniho/py-guard
6
6
  Author: Wunsun Tarniho
@@ -37,3 +37,9 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
37
37
 
38
38
  ## v1.0.6 (2024-07-20)
39
39
  - Fixed: Libary deprecated.
40
+
41
+ ## v1.0.7 (2024-07-20)
42
+ - Fixed: Libary deprecated.
43
+
44
+ ## v1.0.8 (2024-07-20)
45
+ - Fixed: Libary deprecated.
@@ -17,4 +17,10 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
17
17
  - Fixed: Libary deprecated.
18
18
 
19
19
  ## v1.0.6 (2024-07-20)
20
+ - Fixed: Libary deprecated.
21
+
22
+ ## v1.0.7 (2024-07-20)
23
+ - Fixed: Libary deprecated.
24
+
25
+ ## v1.0.8 (2024-07-20)
20
26
  - Fixed: Libary deprecated.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: safeshield
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: Library for Help Validation Control
5
5
  Home-page: https://github.com/WunsunTarniho/py-guard
6
6
  Author: Wunsun Tarniho
@@ -37,3 +37,9 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
37
37
 
38
38
  ## v1.0.6 (2024-07-20)
39
39
  - Fixed: Libary deprecated.
40
+
41
+ ## v1.0.7 (2024-07-20)
42
+ - Fixed: Libary deprecated.
43
+
44
+ ## v1.0.8 (2024-07-20)
45
+ - Fixed: Libary deprecated.
@@ -7,7 +7,7 @@ def get_requirements():
7
7
 
8
8
  setup(
9
9
  name="safeshield", # Nama package di PyPI
10
- version="1.0.6",
10
+ version="1.0.8",
11
11
  packages=find_packages(),
12
12
  install_requires=get_requirements(),
13
13
  author="Wunsun Tarniho",
@@ -1,6 +1,5 @@
1
1
  import inspect
2
2
  from .base import ValidationRule
3
- from validator.utils.string import pascal_to_snake
4
3
  from . import array, basic, comparison, date, type, files, format, conditional, string, utilities
5
4
 
6
5
  def _collect_rules():
@@ -1,4 +1,4 @@
1
- from validator.rules.base import ValidationRule
1
+ from .base import ValidationRule
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
 
4
4
  class ArrayRule(ValidationRule):
@@ -1,8 +1,9 @@
1
1
  from abc import ABC, abstractmethod
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
  from enum import Enum
4
- from .string import pascal_to_snake
4
+ # from .string import pascal_to_snake
5
5
  import inspect
6
+ import re
6
7
 
7
8
  class ValidationRule(ABC):
8
9
  """Abstract base class for all validation rules"""
@@ -12,7 +13,7 @@ class ValidationRule(ABC):
12
13
  self._params: List[str] = list(params)
13
14
 
14
15
  def __init_subclass__(cls):
15
- cls.rule_name = pascal_to_snake(cls.__name__)
16
+ cls.rule_name = cls.pascal_to_snake(cls.__name__)
16
17
 
17
18
  @property
18
19
  def params(self) -> List[str]:
@@ -81,4 +82,20 @@ class ValidationRule(ABC):
81
82
 
82
83
  param_str = ' ,'.join(params)
83
84
 
84
- return [v.strip() for v in param_str.split(',') if v.strip()]
85
+ return [v.strip() for v in param_str.split(',') if v.strip()]
86
+
87
+ def pascal_to_snake(name):
88
+ """Convert PascalCase to snake_case"""
89
+ # Handle kasus khusus terlebih dahulu
90
+ special_cases = {
91
+ 'UUIDRule': 'uuid',
92
+ 'IPRule': 'ip',
93
+ 'URLRule': 'url'
94
+ }
95
+ if name in special_cases:
96
+ return special_cases[name]
97
+
98
+ # Konversi regular PascalCase ke snake_case
99
+ s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
100
+ result = re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
101
+ return result.replace('_rule', '')
@@ -1,4 +1,4 @@
1
- from validator.rules.base import ValidationRule
1
+ from .base import ValidationRule
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
 
4
4
  # =============================================
@@ -1,4 +1,4 @@
1
- from validator.rules.base import ValidationRule
1
+ from .base import ValidationRule
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
 
4
4
  # =============================================
@@ -1,4 +1,4 @@
1
- from validator.rules.base import ValidationRule
1
+ from .base import ValidationRule
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
  from enum import Enum
4
4
  import re
@@ -1,4 +1,4 @@
1
- from validator.rules.base import ValidationRule
1
+ from .base import ValidationRule
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
  from datetime import datetime
4
4
  from dateutil.parser import parse
@@ -1,4 +1,4 @@
1
- from validator.rules.base import ValidationRule
1
+ from .base import ValidationRule
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
 
4
4
  class FileRule(ValidationRule):
@@ -1,4 +1,4 @@
1
- from validator.rules.base import ValidationRule
1
+ from .base import ValidationRule
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
  import re
4
4
  import zoneinfo
@@ -1,4 +1,4 @@
1
- from validator.rules.base import ValidationRule
1
+ from .base import ValidationRule
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
  import re
4
4
 
@@ -1,4 +1,4 @@
1
- from validator.rules.base import ValidationRule
1
+ from .base import ValidationRule
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
  from datetime import datetime
4
4
 
@@ -1,4 +1,4 @@
1
- from validator.rules.base import ValidationRule
1
+ from .base import ValidationRule
2
2
  from typing import Any, Dict, List, Optional, Set, Union, Tuple, Type
3
3
 
4
4
  class AnyOfRule(ValidationRule):
@@ -0,0 +1,5 @@
1
+ from .rule_preparer import RulePreparer
2
+ from .rule_error_handler import RuleErrorHandler
3
+ from .rule_conflict import RuleConflictChecker
4
+
5
+ __all__ = {'RulePreparer', 'RuleErrorHandler', 'RuleConflictChecker'}
@@ -1,5 +0,0 @@
1
- from validator.services.rule_preparer import RulePreparer
2
- from validator.services.rule_error_handler import RuleErrorHandler
3
- from validator.services.rule_conflict import RuleConflictChecker
4
-
5
- __all__ = {'RulePreparer', 'RuleErrorHandler', 'RuleConflictChecker'}
File without changes
File without changes