safeshield 1.6.8__py3-none-any.whl → 1.6.10__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.
- {safeshield-1.6.8.dist-info → safeshield-1.6.10.dist-info}/METADATA +2 -3
- {safeshield-1.6.8.dist-info → safeshield-1.6.10.dist-info}/RECORD +6 -6
- validator/rules/date.py +12 -13
- {safeshield-1.6.8.dist-info → safeshield-1.6.10.dist-info}/WHEEL +0 -0
- {safeshield-1.6.8.dist-info → safeshield-1.6.10.dist-info}/licenses/LICENSE +0 -0
- {safeshield-1.6.8.dist-info → safeshield-1.6.10.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: safeshield
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.10
|
|
4
4
|
Summary: Library for Help Validation Control
|
|
5
5
|
Home-page: https://github.com/WunsunTarniho/py-guard
|
|
6
6
|
Author: Wunsun Tarniho
|
|
@@ -21,11 +21,10 @@ Requires-Dist: Pillow==11.2.1
|
|
|
21
21
|
Requires-Dist: psycopg2-binary==2.9.9
|
|
22
22
|
Requires-Dist: python-dotenv==1.1.1
|
|
23
23
|
Requires-Dist: python_dateutil==2.9.0.post0
|
|
24
|
-
Requires-Dist: setuptools==75.8.2
|
|
25
24
|
Requires-Dist: SQLAlchemy==2.0.41
|
|
26
25
|
Requires-Dist: Werkzeug==1.0.1
|
|
27
26
|
Requires-Dist: dnspython==2.4.2
|
|
28
|
-
Requires-Dist: idna==3.
|
|
27
|
+
Requires-Dist: idna==3.6
|
|
29
28
|
Dynamic: author
|
|
30
29
|
Dynamic: author-email
|
|
31
30
|
Dynamic: classifier
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
safeshield-1.6.
|
|
1
|
+
safeshield-1.6.10.dist-info/licenses/LICENSE,sha256=YxHGBtuH0Vsy-KPvW2_afKE54XIrf1eipLF4v6kaybI,35276
|
|
2
2
|
validator/__init__.py,sha256=udxDzUicPfxBOAQvzsnl3pHur9VUppKbWMgg35hpiww,244
|
|
3
3
|
validator/exceptions.py,sha256=y2v7CaXmeGFHWcnigtLl4U-sFta_jMiXkGKXWIIVglY,366
|
|
4
4
|
validator/factory.py,sha256=P9D-qbXmhY6LjZZSTKNRNK2YuRmjE7aKIEJud6pWMrk,1175
|
|
@@ -13,7 +13,7 @@ validator/rules/base.py,sha256=fFc12nUmaPWzoDFvikn7aFQiRsK5zoP5Ld4qBK9fHDE,5871
|
|
|
13
13
|
validator/rules/basic.py,sha256=8k-REzsSyknhNuw0vPKMxtovvJBVlyZDihXXVznRQpM,6420
|
|
14
14
|
validator/rules/boolean.py,sha256=UuSO9BdBMR5l6sB3dgZqoqOVjqu47yjFrmJ7xylTVKs,5452
|
|
15
15
|
validator/rules/comparison.py,sha256=BnPPPkf_5TiWNbWX-HzYtpqMpeWWKF2vaj5yXoxMpjc,15863
|
|
16
|
-
validator/rules/date.py,sha256=
|
|
16
|
+
validator/rules/date.py,sha256=j-02SYtIPQVDi_MciOYjDqIyFdW3Sw055KjE0Th4MiE,7544
|
|
17
17
|
validator/rules/files.py,sha256=3Q0KoadDKqNIiVlBR7b5b-XBs4gOg3ZFu7wU7SrdqWQ,12280
|
|
18
18
|
validator/rules/format.py,sha256=u_BhPQwW30JYHwZIjHD0ZX449csgTPPCJOeoXaQr4M4,7361
|
|
19
19
|
validator/rules/numeric.py,sha256=aY-SU_fgfdm1Em5UFU1t1XbGw9s-FMVyJ5w6IuJ_Ad8,8831
|
|
@@ -25,7 +25,7 @@ validator/services/rule_error_handler.py,sha256=l4jA6WtTRBNGytVA_nSwJpbix_viNWhq
|
|
|
25
25
|
validator/services/rule_preparer.py,sha256=7HSMuSGGgaYWv8dt_m7pL5MQkJcTwFBH9gfmCZwzt8U,5284
|
|
26
26
|
validator/utils/__init__.py,sha256=Yzo-xv285Be-a233M4duDdYtscuHiuBbPSX_C8yViJI,20
|
|
27
27
|
validator/utils/string.py,sha256=0YACzeEaWNEOR9_7O9A8D1ItIbtWfOJ8IfrzcB8VMYA,515
|
|
28
|
-
safeshield-1.6.
|
|
29
|
-
safeshield-1.6.
|
|
30
|
-
safeshield-1.6.
|
|
31
|
-
safeshield-1.6.
|
|
28
|
+
safeshield-1.6.10.dist-info/METADATA,sha256=yqVXmL2WarrrkMx8NnL9dM2KH3NVcEnnmpsax5hSgsI,6630
|
|
29
|
+
safeshield-1.6.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
30
|
+
safeshield-1.6.10.dist-info/top_level.txt,sha256=iUtV3dlHOIiMfLuY4pruY00lFni8JzOkQ3Nh1II19OE,10
|
|
31
|
+
safeshield-1.6.10.dist-info/RECORD,,
|
validator/rules/date.py
CHANGED
|
@@ -10,7 +10,7 @@ class DateRule(Rule):
|
|
|
10
10
|
return False
|
|
11
11
|
|
|
12
12
|
try:
|
|
13
|
-
|
|
13
|
+
datetime.strptime(value, "%Y-%m-%d")
|
|
14
14
|
return True
|
|
15
15
|
except ValueError:
|
|
16
16
|
return False
|
|
@@ -25,7 +25,7 @@ class DateEqualsRule(Rule):
|
|
|
25
25
|
|
|
26
26
|
try:
|
|
27
27
|
if isinstance(value, str):
|
|
28
|
-
date1 =
|
|
28
|
+
date1 = datetime.strptime(value, "%Y-%m-%d")
|
|
29
29
|
elif isinstance(value, datetime):
|
|
30
30
|
date1 = value
|
|
31
31
|
else:
|
|
@@ -34,7 +34,7 @@ class DateEqualsRule(Rule):
|
|
|
34
34
|
params = list(params)
|
|
35
35
|
params[0] = self.get_field_value(params[0], params[0])
|
|
36
36
|
|
|
37
|
-
date2 =
|
|
37
|
+
date2 = datetime.strptime(params[0], "%Y-%m-%d")
|
|
38
38
|
return date1 == date2
|
|
39
39
|
except ValueError as e:
|
|
40
40
|
return False
|
|
@@ -57,7 +57,7 @@ class AfterRule(Rule):
|
|
|
57
57
|
def validate(self, field: str, value: Any, params: List[str]) -> bool:
|
|
58
58
|
try:
|
|
59
59
|
if isinstance(value, str):
|
|
60
|
-
date_value =
|
|
60
|
+
date_value = datetime.strptime(value, "%Y-%m-%d")
|
|
61
61
|
elif isinstance(value, datetime):
|
|
62
62
|
date_value = value
|
|
63
63
|
else:
|
|
@@ -66,7 +66,7 @@ class AfterRule(Rule):
|
|
|
66
66
|
|
|
67
67
|
params = list(params)# Parse comparison date
|
|
68
68
|
params[0] = self.get_field_value(params[0], params[0])
|
|
69
|
-
compare_date =
|
|
69
|
+
compare_date = datetime.strptime(params[0], "%Y-%m-%d")
|
|
70
70
|
|
|
71
71
|
return date_value > compare_date
|
|
72
72
|
|
|
@@ -91,7 +91,7 @@ class AfterOrEqualRule(Rule):
|
|
|
91
91
|
def validate(self, field: str, value: Any, params: List[str]) -> bool:
|
|
92
92
|
try:
|
|
93
93
|
if isinstance(value, str):
|
|
94
|
-
date_value =
|
|
94
|
+
date_value = datetime.strptime(value, "%Y-%m-%d")
|
|
95
95
|
elif isinstance(value, datetime):
|
|
96
96
|
date_value = value
|
|
97
97
|
else:
|
|
@@ -99,7 +99,7 @@ class AfterOrEqualRule(Rule):
|
|
|
99
99
|
|
|
100
100
|
params = list(params)
|
|
101
101
|
params[0] = self.get_field_value(params[0], params[0])
|
|
102
|
-
compare_date =
|
|
102
|
+
compare_date = datetime.strptime(params, "%Y-%m-%d")
|
|
103
103
|
|
|
104
104
|
return date_value >= compare_date
|
|
105
105
|
|
|
@@ -126,7 +126,7 @@ class BeforeRule(Rule):
|
|
|
126
126
|
|
|
127
127
|
try:
|
|
128
128
|
if isinstance(value, str):
|
|
129
|
-
date_value =
|
|
129
|
+
date_value = datetime.strptime(value, "%Y-%m-%d")
|
|
130
130
|
elif isinstance(value, datetime):
|
|
131
131
|
date_value = value
|
|
132
132
|
else:
|
|
@@ -134,7 +134,7 @@ class BeforeRule(Rule):
|
|
|
134
134
|
|
|
135
135
|
params = list(params)
|
|
136
136
|
params[0] = self.get_field_value(params[0], params[0])
|
|
137
|
-
compare_date =
|
|
137
|
+
compare_date = datetime.strptime(params[0], "%Y-%m-%d")
|
|
138
138
|
|
|
139
139
|
return date_value < compare_date
|
|
140
140
|
|
|
@@ -161,7 +161,7 @@ class BeforeOrEqualRule(Rule):
|
|
|
161
161
|
|
|
162
162
|
try:
|
|
163
163
|
if isinstance(value, str):
|
|
164
|
-
date_value =
|
|
164
|
+
date_value = datetime.strptime(value, "%Y-%m-%d")
|
|
165
165
|
elif isinstance(value, datetime):
|
|
166
166
|
date_value = value
|
|
167
167
|
else:
|
|
@@ -169,11 +169,10 @@ class BeforeOrEqualRule(Rule):
|
|
|
169
169
|
|
|
170
170
|
params = list(params)
|
|
171
171
|
params[0] = self.get_field_value(params[0], params[0])
|
|
172
|
-
compare_date =
|
|
172
|
+
compare_date = datetime.strptime(params[0], "%Y-%m-%d")
|
|
173
173
|
|
|
174
174
|
return date_value <= compare_date
|
|
175
|
-
|
|
176
|
-
except (ValueError, TypeError):
|
|
175
|
+
except (ValueError, TypeError) as e:
|
|
177
176
|
return False
|
|
178
177
|
|
|
179
178
|
def message(self, field: str, params: List[str]) -> str:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|