potato-util 0.0.5__tar.gz → 0.1.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.
- {potato_util-0.0.5/src/potato_util.egg-info → potato_util-0.1.0}/PKG-INFO +9 -9
- {potato_util-0.0.5 → potato_util-0.1.0}/requirements/requirements.async.txt +1 -1
- {potato_util-0.0.5 → potato_util-0.1.0}/requirements/requirements.docs.txt +1 -1
- {potato_util-0.0.5 → potato_util-0.1.0}/requirements/requirements.test.txt +1 -1
- potato_util-0.1.0/src/potato_util/__version__.py +1 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/_base.py +22 -0
- {potato_util-0.0.5 → potato_util-0.1.0/src/potato_util.egg-info}/PKG-INFO +9 -9
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util.egg-info/requires.txt +8 -8
- potato_util-0.0.5/src/potato_util/__version__.py +0 -1
- {potato_util-0.0.5 → potato_util-0.1.0}/.python-version +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/LICENSE.txt +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/README.md +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/pyproject.toml +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/requirements/requirements.build.txt +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/requirements/requirements.dev.txt +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/requirements/requirements.fastapi.txt +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/requirements.txt +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/setup.cfg +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/setup.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/__init__.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/constants/__init__.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/constants/_base.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/constants/_enum.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/constants/_regex.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/dt.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/generator.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/http/__init__.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/http/_async.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/http/_base.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/http/_sync.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/http/fastapi.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/io/__init__.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/io/_async.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/io/_sync.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/sanitizer.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/secure.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util/validator.py +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util.egg-info/SOURCES.txt +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util.egg-info/dependency_links.txt +0 -0
- {potato_util-0.0.5 → potato_util-0.1.0}/src/potato_util.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: potato_util
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: 'potato_util' is collection of simple useful utils package for python.
|
|
5
5
|
Author-email: Batkhuu Byambajav <batkhuu10@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/bybatkhuu/module-python-utils
|
|
@@ -25,22 +25,22 @@ Requires-Dist: python-dotenv<2.0.0,>=1.0.1
|
|
|
25
25
|
Requires-Dist: pydantic[email,timezone]<3.0.0,>=2.0.3
|
|
26
26
|
Requires-Dist: pydantic-settings<3.0.0,>=2.2.1
|
|
27
27
|
Provides-Extra: async
|
|
28
|
-
Requires-Dist: aiofiles<
|
|
28
|
+
Requires-Dist: aiofiles<26.0.0,>=24.1.0; extra == "async"
|
|
29
29
|
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "async"
|
|
30
30
|
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "async"
|
|
31
31
|
Provides-Extra: fastapi
|
|
32
32
|
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "fastapi"
|
|
33
33
|
Provides-Extra: all
|
|
34
|
-
Requires-Dist: aiofiles<
|
|
34
|
+
Requires-Dist: aiofiles<26.0.0,>=24.1.0; extra == "all"
|
|
35
35
|
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "all"
|
|
36
36
|
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "all"
|
|
37
37
|
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "all"
|
|
38
38
|
Provides-Extra: test
|
|
39
|
-
Requires-Dist: aiofiles<
|
|
39
|
+
Requires-Dist: aiofiles<26.0.0,>=24.1.0; extra == "test"
|
|
40
40
|
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "test"
|
|
41
41
|
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "test"
|
|
42
42
|
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "test"
|
|
43
|
-
Requires-Dist: pytest<
|
|
43
|
+
Requires-Dist: pytest<10.0.0,>=8.0.2; extra == "test"
|
|
44
44
|
Requires-Dist: pytest-cov<8.0.0,>=5.0.0; extra == "test"
|
|
45
45
|
Requires-Dist: pytest-xdist<4.0.0,>=3.6.1; extra == "test"
|
|
46
46
|
Requires-Dist: pytest-benchmark<6.0.0,>=5.0.1; extra == "test"
|
|
@@ -50,17 +50,17 @@ Requires-Dist: wheel<1.0.0,>=0.43.0; extra == "build"
|
|
|
50
50
|
Requires-Dist: build<2.0.0,>=1.1.1; extra == "build"
|
|
51
51
|
Requires-Dist: twine<7.0.0,>=6.0.1; extra == "build"
|
|
52
52
|
Provides-Extra: docs
|
|
53
|
-
Requires-Dist: pylint<
|
|
53
|
+
Requires-Dist: pylint<5.0.0,>=3.0.4; extra == "docs"
|
|
54
54
|
Requires-Dist: mkdocs-material<10.0.0,>=9.5.50; extra == "docs"
|
|
55
55
|
Requires-Dist: mkdocs-awesome-nav<4.0.0,>=3.0.0; extra == "docs"
|
|
56
56
|
Requires-Dist: mkdocstrings[python]<1.0.0,>=0.24.3; extra == "docs"
|
|
57
57
|
Requires-Dist: mike<3.0.0,>=2.1.3; extra == "docs"
|
|
58
58
|
Provides-Extra: dev
|
|
59
|
-
Requires-Dist: aiofiles<
|
|
59
|
+
Requires-Dist: aiofiles<26.0.0,>=24.1.0; extra == "dev"
|
|
60
60
|
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "dev"
|
|
61
61
|
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "dev"
|
|
62
62
|
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "dev"
|
|
63
|
-
Requires-Dist: pytest<
|
|
63
|
+
Requires-Dist: pytest<10.0.0,>=8.0.2; extra == "dev"
|
|
64
64
|
Requires-Dist: pytest-cov<8.0.0,>=5.0.0; extra == "dev"
|
|
65
65
|
Requires-Dist: pytest-xdist<4.0.0,>=3.6.1; extra == "dev"
|
|
66
66
|
Requires-Dist: pytest-benchmark<6.0.0,>=5.0.1; extra == "dev"
|
|
@@ -68,7 +68,7 @@ Requires-Dist: setuptools<81.0.0,>=70.3.0; extra == "dev"
|
|
|
68
68
|
Requires-Dist: wheel<1.0.0,>=0.43.0; extra == "dev"
|
|
69
69
|
Requires-Dist: build<2.0.0,>=1.1.1; extra == "dev"
|
|
70
70
|
Requires-Dist: twine<7.0.0,>=6.0.1; extra == "dev"
|
|
71
|
-
Requires-Dist: pylint<
|
|
71
|
+
Requires-Dist: pylint<5.0.0,>=3.0.4; extra == "dev"
|
|
72
72
|
Requires-Dist: mkdocs-material<10.0.0,>=9.5.50; extra == "dev"
|
|
73
73
|
Requires-Dist: mkdocs-awesome-nav<4.0.0,>=3.0.0; extra == "dev"
|
|
74
74
|
Requires-Dist: mkdocstrings[python]<1.0.0,>=0.24.3; extra == "dev"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
@@ -6,6 +6,8 @@ import logging
|
|
|
6
6
|
|
|
7
7
|
from pydantic import validate_call
|
|
8
8
|
|
|
9
|
+
from .validator import is_truthy
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
logger = logging.getLogger(__name__)
|
|
11
13
|
|
|
@@ -78,8 +80,28 @@ def get_slug_name(file_path: str | None = None) -> str:
|
|
|
78
80
|
return _slug_name
|
|
79
81
|
|
|
80
82
|
|
|
83
|
+
def is_debug_mode() -> bool:
|
|
84
|
+
"""Check if the application is running in debug mode based on environment variables.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
bool: True if in debug mode, False otherwise.
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
_is_debug = False
|
|
91
|
+
_debug = os.getenv("DEBUG", "").strip().lower()
|
|
92
|
+
if _debug and is_truthy(_debug):
|
|
93
|
+
_is_debug = True
|
|
94
|
+
|
|
95
|
+
_env = os.getenv("ENV", "").strip().lower()
|
|
96
|
+
if (_env == "development") and (_debug == ""):
|
|
97
|
+
_is_debug = True
|
|
98
|
+
|
|
99
|
+
return _is_debug
|
|
100
|
+
|
|
101
|
+
|
|
81
102
|
__all__ = [
|
|
82
103
|
"deep_merge",
|
|
83
104
|
"camel_to_snake",
|
|
84
105
|
"get_slug_name",
|
|
106
|
+
"is_debug_mode",
|
|
85
107
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: potato_util
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: 'potato_util' is collection of simple useful utils package for python.
|
|
5
5
|
Author-email: Batkhuu Byambajav <batkhuu10@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/bybatkhuu/module-python-utils
|
|
@@ -25,22 +25,22 @@ Requires-Dist: python-dotenv<2.0.0,>=1.0.1
|
|
|
25
25
|
Requires-Dist: pydantic[email,timezone]<3.0.0,>=2.0.3
|
|
26
26
|
Requires-Dist: pydantic-settings<3.0.0,>=2.2.1
|
|
27
27
|
Provides-Extra: async
|
|
28
|
-
Requires-Dist: aiofiles<
|
|
28
|
+
Requires-Dist: aiofiles<26.0.0,>=24.1.0; extra == "async"
|
|
29
29
|
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "async"
|
|
30
30
|
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "async"
|
|
31
31
|
Provides-Extra: fastapi
|
|
32
32
|
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "fastapi"
|
|
33
33
|
Provides-Extra: all
|
|
34
|
-
Requires-Dist: aiofiles<
|
|
34
|
+
Requires-Dist: aiofiles<26.0.0,>=24.1.0; extra == "all"
|
|
35
35
|
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "all"
|
|
36
36
|
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "all"
|
|
37
37
|
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "all"
|
|
38
38
|
Provides-Extra: test
|
|
39
|
-
Requires-Dist: aiofiles<
|
|
39
|
+
Requires-Dist: aiofiles<26.0.0,>=24.1.0; extra == "test"
|
|
40
40
|
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "test"
|
|
41
41
|
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "test"
|
|
42
42
|
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "test"
|
|
43
|
-
Requires-Dist: pytest<
|
|
43
|
+
Requires-Dist: pytest<10.0.0,>=8.0.2; extra == "test"
|
|
44
44
|
Requires-Dist: pytest-cov<8.0.0,>=5.0.0; extra == "test"
|
|
45
45
|
Requires-Dist: pytest-xdist<4.0.0,>=3.6.1; extra == "test"
|
|
46
46
|
Requires-Dist: pytest-benchmark<6.0.0,>=5.0.1; extra == "test"
|
|
@@ -50,17 +50,17 @@ Requires-Dist: wheel<1.0.0,>=0.43.0; extra == "build"
|
|
|
50
50
|
Requires-Dist: build<2.0.0,>=1.1.1; extra == "build"
|
|
51
51
|
Requires-Dist: twine<7.0.0,>=6.0.1; extra == "build"
|
|
52
52
|
Provides-Extra: docs
|
|
53
|
-
Requires-Dist: pylint<
|
|
53
|
+
Requires-Dist: pylint<5.0.0,>=3.0.4; extra == "docs"
|
|
54
54
|
Requires-Dist: mkdocs-material<10.0.0,>=9.5.50; extra == "docs"
|
|
55
55
|
Requires-Dist: mkdocs-awesome-nav<4.0.0,>=3.0.0; extra == "docs"
|
|
56
56
|
Requires-Dist: mkdocstrings[python]<1.0.0,>=0.24.3; extra == "docs"
|
|
57
57
|
Requires-Dist: mike<3.0.0,>=2.1.3; extra == "docs"
|
|
58
58
|
Provides-Extra: dev
|
|
59
|
-
Requires-Dist: aiofiles<
|
|
59
|
+
Requires-Dist: aiofiles<26.0.0,>=24.1.0; extra == "dev"
|
|
60
60
|
Requires-Dist: aioshutil<2.0.0,>=1.5; extra == "dev"
|
|
61
61
|
Requires-Dist: aiohttp<4.0.0,>=3.11.18; extra == "dev"
|
|
62
62
|
Requires-Dist: fastapi<1.0.0,>=0.109.2; extra == "dev"
|
|
63
|
-
Requires-Dist: pytest<
|
|
63
|
+
Requires-Dist: pytest<10.0.0,>=8.0.2; extra == "dev"
|
|
64
64
|
Requires-Dist: pytest-cov<8.0.0,>=5.0.0; extra == "dev"
|
|
65
65
|
Requires-Dist: pytest-xdist<4.0.0,>=3.6.1; extra == "dev"
|
|
66
66
|
Requires-Dist: pytest-benchmark<6.0.0,>=5.0.1; extra == "dev"
|
|
@@ -68,7 +68,7 @@ Requires-Dist: setuptools<81.0.0,>=70.3.0; extra == "dev"
|
|
|
68
68
|
Requires-Dist: wheel<1.0.0,>=0.43.0; extra == "dev"
|
|
69
69
|
Requires-Dist: build<2.0.0,>=1.1.1; extra == "dev"
|
|
70
70
|
Requires-Dist: twine<7.0.0,>=6.0.1; extra == "dev"
|
|
71
|
-
Requires-Dist: pylint<
|
|
71
|
+
Requires-Dist: pylint<5.0.0,>=3.0.4; extra == "dev"
|
|
72
72
|
Requires-Dist: mkdocs-material<10.0.0,>=9.5.50; extra == "dev"
|
|
73
73
|
Requires-Dist: mkdocs-awesome-nav<4.0.0,>=3.0.0; extra == "dev"
|
|
74
74
|
Requires-Dist: mkdocstrings[python]<1.0.0,>=0.24.3; extra == "dev"
|
|
@@ -3,13 +3,13 @@ pydantic[email,timezone]<3.0.0,>=2.0.3
|
|
|
3
3
|
pydantic-settings<3.0.0,>=2.2.1
|
|
4
4
|
|
|
5
5
|
[all]
|
|
6
|
-
aiofiles<
|
|
6
|
+
aiofiles<26.0.0,>=24.1.0
|
|
7
7
|
aioshutil<2.0.0,>=1.5
|
|
8
8
|
aiohttp<4.0.0,>=3.11.18
|
|
9
9
|
fastapi<1.0.0,>=0.109.2
|
|
10
10
|
|
|
11
11
|
[async]
|
|
12
|
-
aiofiles<
|
|
12
|
+
aiofiles<26.0.0,>=24.1.0
|
|
13
13
|
aioshutil<2.0.0,>=1.5
|
|
14
14
|
aiohttp<4.0.0,>=3.11.18
|
|
15
15
|
|
|
@@ -20,11 +20,11 @@ build<2.0.0,>=1.1.1
|
|
|
20
20
|
twine<7.0.0,>=6.0.1
|
|
21
21
|
|
|
22
22
|
[dev]
|
|
23
|
-
aiofiles<
|
|
23
|
+
aiofiles<26.0.0,>=24.1.0
|
|
24
24
|
aioshutil<2.0.0,>=1.5
|
|
25
25
|
aiohttp<4.0.0,>=3.11.18
|
|
26
26
|
fastapi<1.0.0,>=0.109.2
|
|
27
|
-
pytest<
|
|
27
|
+
pytest<10.0.0,>=8.0.2
|
|
28
28
|
pytest-cov<8.0.0,>=5.0.0
|
|
29
29
|
pytest-xdist<4.0.0,>=3.6.1
|
|
30
30
|
pytest-benchmark<6.0.0,>=5.0.1
|
|
@@ -32,7 +32,7 @@ setuptools<81.0.0,>=70.3.0
|
|
|
32
32
|
wheel<1.0.0,>=0.43.0
|
|
33
33
|
build<2.0.0,>=1.1.1
|
|
34
34
|
twine<7.0.0,>=6.0.1
|
|
35
|
-
pylint<
|
|
35
|
+
pylint<5.0.0,>=3.0.4
|
|
36
36
|
mkdocs-material<10.0.0,>=9.5.50
|
|
37
37
|
mkdocs-awesome-nav<4.0.0,>=3.0.0
|
|
38
38
|
mkdocstrings[python]<1.0.0,>=0.24.3
|
|
@@ -41,7 +41,7 @@ pyright<2.0.0,>=1.1.392
|
|
|
41
41
|
pre-commit<5.0.0,>=4.0.1
|
|
42
42
|
|
|
43
43
|
[docs]
|
|
44
|
-
pylint<
|
|
44
|
+
pylint<5.0.0,>=3.0.4
|
|
45
45
|
mkdocs-material<10.0.0,>=9.5.50
|
|
46
46
|
mkdocs-awesome-nav<4.0.0,>=3.0.0
|
|
47
47
|
mkdocstrings[python]<1.0.0,>=0.24.3
|
|
@@ -51,11 +51,11 @@ mike<3.0.0,>=2.1.3
|
|
|
51
51
|
fastapi<1.0.0,>=0.109.2
|
|
52
52
|
|
|
53
53
|
[test]
|
|
54
|
-
aiofiles<
|
|
54
|
+
aiofiles<26.0.0,>=24.1.0
|
|
55
55
|
aioshutil<2.0.0,>=1.5
|
|
56
56
|
aiohttp<4.0.0,>=3.11.18
|
|
57
57
|
fastapi<1.0.0,>=0.109.2
|
|
58
|
-
pytest<
|
|
58
|
+
pytest<10.0.0,>=8.0.2
|
|
59
59
|
pytest-cov<8.0.0,>=5.0.0
|
|
60
60
|
pytest-xdist<4.0.0,>=3.6.1
|
|
61
61
|
pytest-benchmark<6.0.0,>=5.0.1
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|