pyis 1.10.5__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.
- pyis/__init__.py +3 -0
- pyis/pyis.py +66 -0
- pyis-1.10.5.dist-info/METADATA +51 -0
- pyis-1.10.5.dist-info/RECORD +7 -0
- pyis-1.10.5.dist-info/WHEEL +5 -0
- pyis-1.10.5.dist-info/licenses/LICENSE +21 -0
- pyis-1.10.5.dist-info/top_level.txt +1 -0
pyis/__init__.py
ADDED
pyis/pyis.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class validations:
|
|
5
|
+
"""Collection of value validation utilities."""
|
|
6
|
+
|
|
7
|
+
class type:
|
|
8
|
+
"""Type validation utilities."""
|
|
9
|
+
|
|
10
|
+
@staticmethod
|
|
11
|
+
def is_int(var: Any) -> bool:
|
|
12
|
+
return type(var) is int
|
|
13
|
+
|
|
14
|
+
@staticmethod
|
|
15
|
+
def is_string(var: Any) -> bool:
|
|
16
|
+
return type(var) is str
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def is_float(var: Any) -> bool:
|
|
20
|
+
return type(var) is float
|
|
21
|
+
|
|
22
|
+
@staticmethod
|
|
23
|
+
def is_list(var: Any) -> bool:
|
|
24
|
+
return type(var) is list
|
|
25
|
+
|
|
26
|
+
@staticmethod
|
|
27
|
+
def is_bool(var: Any) -> bool:
|
|
28
|
+
return type(var) is bool
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def is_dict(var: Any) -> bool:
|
|
32
|
+
return type(var) is dict
|
|
33
|
+
|
|
34
|
+
@staticmethod
|
|
35
|
+
def is_tuple(var: Any) -> bool:
|
|
36
|
+
return type(var) is tuple
|
|
37
|
+
|
|
38
|
+
@staticmethod
|
|
39
|
+
def is_function(var: Any) -> bool:
|
|
40
|
+
return callable(var)
|
|
41
|
+
|
|
42
|
+
class amount:
|
|
43
|
+
"""Value presence validation utilities."""
|
|
44
|
+
|
|
45
|
+
@staticmethod
|
|
46
|
+
def is_set(var: Any) -> bool:
|
|
47
|
+
return var is not None
|
|
48
|
+
|
|
49
|
+
@staticmethod
|
|
50
|
+
def is_empty(var: Any) -> bool:
|
|
51
|
+
return var is None
|
|
52
|
+
|
|
53
|
+
class numbers:
|
|
54
|
+
"""Numeric comparison validation utilities."""
|
|
55
|
+
|
|
56
|
+
@staticmethod
|
|
57
|
+
def is_positive(var: int | float) -> bool:
|
|
58
|
+
return var > 0
|
|
59
|
+
|
|
60
|
+
@staticmethod
|
|
61
|
+
def is_negative(var: int | float) -> bool:
|
|
62
|
+
return var < 0
|
|
63
|
+
|
|
64
|
+
@staticmethod
|
|
65
|
+
def is_zero(var: int | float) -> bool:
|
|
66
|
+
return var == 0
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyis
|
|
3
|
+
Version: 1.10.5
|
|
4
|
+
Summary: A Python library for value validation and internet status checks
|
|
5
|
+
Author-email: Amirhossein Mohammadi <amirhosseinmohammadi1380@yahoo.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2021 AmirHossein Mohammadi
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://gitlab.com/blackiq-packages/pypi/pyis
|
|
29
|
+
Project-URL: Repository, https://gitlab.com/blackiq-packages/pypi/pyis
|
|
30
|
+
Project-URL: Issues, https://gitlab.com/blackiq-packages/pypi/pyis/-/issues
|
|
31
|
+
Keywords: validation,type-checking,internet,http,utilities
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Programming Language :: Python :: 3
|
|
36
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
37
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
38
|
+
Requires-Python: >=3.10
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
License-File: LICENSE
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
## pyis
|
|
44
|
+
|
|
45
|
+
**pyis** is a library to make your conditions easier.
|
|
46
|
+
With **pyis** you don't need to write long conditions. Just use **pyis** classes.
|
|
47
|
+
|
|
48
|
+
- [Installation]()
|
|
49
|
+
- [Documentation]()
|
|
50
|
+
|
|
51
|
+
**pyis** 2021 © Licensed under MIT license.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pyis/__init__.py,sha256=VeSFm8H6I2tAMLPZDvKeGM2h8CVhAbEQ3J02xeMt3bc,61
|
|
2
|
+
pyis/pyis.py,sha256=-B8R7q8gWIOaCduXuSN2E9ZLYwTwfqZbxL-1RmMK5gk,1584
|
|
3
|
+
pyis-1.10.5.dist-info/licenses/LICENSE,sha256=4jzUJcXWaHh_ZF9ueCfcWGkjrn_HVKDc2MgNUS-jpOA,1078
|
|
4
|
+
pyis-1.10.5.dist-info/METADATA,sha256=TO7MtxwaR7NFFiebg68gJ5j3-Syhhu9otw8whPOm6qw,2386
|
|
5
|
+
pyis-1.10.5.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
6
|
+
pyis-1.10.5.dist-info/top_level.txt,sha256=SSTepaZO6z7dEAG55IsCS1Kqo8YITAlQe1no7qBxIbs,5
|
|
7
|
+
pyis-1.10.5.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 AmirHossein Mohammadi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyis
|