potato-util 0.0.4__py3-none-any.whl → 0.0.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.
- potato_util/__version__.py +1 -1
- potato_util/_base.py +28 -0
- {potato_util-0.0.4.dist-info → potato_util-0.0.5.dist-info}/METADATA +1 -1
- {potato_util-0.0.4.dist-info → potato_util-0.0.5.dist-info}/RECORD +7 -7
- {potato_util-0.0.4.dist-info → potato_util-0.0.5.dist-info}/WHEEL +0 -0
- {potato_util-0.0.4.dist-info → potato_util-0.0.5.dist-info}/licenses/LICENSE.txt +0 -0
- {potato_util-0.0.4.dist-info → potato_util-0.0.5.dist-info}/top_level.txt +0 -0
potato_util/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.5"
|
potato_util/_base.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
1
3
|
import re
|
|
2
4
|
import copy
|
|
3
5
|
import logging
|
|
@@ -51,7 +53,33 @@ def camel_to_snake(val: str) -> str:
|
|
|
51
53
|
return val
|
|
52
54
|
|
|
53
55
|
|
|
56
|
+
@validate_call
|
|
57
|
+
def get_slug_name(file_path: str | None = None) -> str:
|
|
58
|
+
"""Slugify the file name from the given file path or the current script's file path.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
file_path (str | None, optional): The file path to slugify. If None, uses the current script's file path.
|
|
62
|
+
Defaults to None.
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
str: The slugified file name.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
if not file_path:
|
|
69
|
+
file_path = sys.argv[0]
|
|
70
|
+
|
|
71
|
+
_slug_name = (
|
|
72
|
+
os.path.splitext(os.path.basename(file_path))[0]
|
|
73
|
+
.strip()
|
|
74
|
+
.replace(" ", "-")
|
|
75
|
+
.replace("_", "-")
|
|
76
|
+
.lower()
|
|
77
|
+
)
|
|
78
|
+
return _slug_name
|
|
79
|
+
|
|
80
|
+
|
|
54
81
|
__all__ = [
|
|
55
82
|
"deep_merge",
|
|
56
83
|
"camel_to_snake",
|
|
84
|
+
"get_slug_name",
|
|
57
85
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: potato_util
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
potato_util/__init__.py,sha256=xl4th2Z_OmTk-3aO1w05Vh8ob0BnX4RcY1fT9tGX61c,74
|
|
2
|
-
potato_util/__version__.py,sha256=
|
|
3
|
-
potato_util/_base.py,sha256=
|
|
2
|
+
potato_util/__version__.py,sha256=S7u1lbuWmM3A3ajykBialmPoJUK6Jg-WmNqM-9OZFdk,22
|
|
3
|
+
potato_util/_base.py,sha256=yWj687li7meg1d7AH1e5rztoyL7z59JunKcBGoDUUJs,2014
|
|
4
4
|
potato_util/dt.py,sha256=DatLzuXOxdanplBv-Kf3qOaomrTCUUBSYv_QgTtQB6U,7635
|
|
5
5
|
potato_util/generator.py,sha256=vdvHj1UrCOQI2WXQHQ2H63PMLQ6yOXAZPNl0m-6BgtY,1572
|
|
6
6
|
potato_util/sanitizer.py,sha256=pZuMDvZxKKIdwFKTcqfmHb9ji-UefSgRgJ8ynHG6UFs,2267
|
|
@@ -18,8 +18,8 @@ potato_util/http/fastapi.py,sha256=iqCxZcQDIVtcqCN9dZ4itcoUs6KzsfRGgK7sRd5EmOA,6
|
|
|
18
18
|
potato_util/io/__init__.py,sha256=FoGcN7t0uArQV4hbMR1X5aeC8Yq-h_ds4xooNpkmgG0,209
|
|
19
19
|
potato_util/io/_async.py,sha256=XVNFDCRII-ib32tksxj5G3nDLsV-ylTW2Hw3_seIY-k,10012
|
|
20
20
|
potato_util/io/_sync.py,sha256=ZVRukOYWWvXtVlU_Gf8GoKnQZqSI2LISHPMmxXi4-2U,9644
|
|
21
|
-
potato_util-0.0.
|
|
22
|
-
potato_util-0.0.
|
|
23
|
-
potato_util-0.0.
|
|
24
|
-
potato_util-0.0.
|
|
25
|
-
potato_util-0.0.
|
|
21
|
+
potato_util-0.0.5.dist-info/licenses/LICENSE.txt,sha256=CUTK-r0BWIg1r0bBiemAcMhakgV0N7HuRhw6rQ-A9A4,1074
|
|
22
|
+
potato_util-0.0.5.dist-info/METADATA,sha256=N5tIucIltyII95e7Q46MW_p8pmUmrfBvUkO_ntDBreQ,15634
|
|
23
|
+
potato_util-0.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
+
potato_util-0.0.5.dist-info/top_level.txt,sha256=pLMnSfT6rhlYBpo2Gnd8kKMDxcuvxdVizqsv1dd1frw,12
|
|
25
|
+
potato_util-0.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|