potato-util 0.0.4__tar.gz → 0.0.5__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.
Files changed (40) hide show
  1. {potato_util-0.0.4/src/potato_util.egg-info → potato_util-0.0.5}/PKG-INFO +1 -1
  2. potato_util-0.0.5/src/potato_util/__version__.py +1 -0
  3. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/_base.py +28 -0
  4. {potato_util-0.0.4 → potato_util-0.0.5/src/potato_util.egg-info}/PKG-INFO +1 -1
  5. potato_util-0.0.4/src/potato_util/__version__.py +0 -1
  6. {potato_util-0.0.4 → potato_util-0.0.5}/.python-version +0 -0
  7. {potato_util-0.0.4 → potato_util-0.0.5}/LICENSE.txt +0 -0
  8. {potato_util-0.0.4 → potato_util-0.0.5}/README.md +0 -0
  9. {potato_util-0.0.4 → potato_util-0.0.5}/pyproject.toml +0 -0
  10. {potato_util-0.0.4 → potato_util-0.0.5}/requirements/requirements.async.txt +0 -0
  11. {potato_util-0.0.4 → potato_util-0.0.5}/requirements/requirements.build.txt +0 -0
  12. {potato_util-0.0.4 → potato_util-0.0.5}/requirements/requirements.dev.txt +0 -0
  13. {potato_util-0.0.4 → potato_util-0.0.5}/requirements/requirements.docs.txt +0 -0
  14. {potato_util-0.0.4 → potato_util-0.0.5}/requirements/requirements.fastapi.txt +0 -0
  15. {potato_util-0.0.4 → potato_util-0.0.5}/requirements/requirements.test.txt +0 -0
  16. {potato_util-0.0.4 → potato_util-0.0.5}/requirements.txt +0 -0
  17. {potato_util-0.0.4 → potato_util-0.0.5}/setup.cfg +0 -0
  18. {potato_util-0.0.4 → potato_util-0.0.5}/setup.py +0 -0
  19. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/__init__.py +0 -0
  20. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/constants/__init__.py +0 -0
  21. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/constants/_base.py +0 -0
  22. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/constants/_enum.py +0 -0
  23. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/constants/_regex.py +0 -0
  24. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/dt.py +0 -0
  25. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/generator.py +0 -0
  26. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/http/__init__.py +0 -0
  27. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/http/_async.py +0 -0
  28. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/http/_base.py +0 -0
  29. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/http/_sync.py +0 -0
  30. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/http/fastapi.py +0 -0
  31. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/io/__init__.py +0 -0
  32. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/io/_async.py +0 -0
  33. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/io/_sync.py +0 -0
  34. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/sanitizer.py +0 -0
  35. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/secure.py +0 -0
  36. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util/validator.py +0 -0
  37. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util.egg-info/SOURCES.txt +0 -0
  38. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util.egg-info/dependency_links.txt +0 -0
  39. {potato_util-0.0.4 → potato_util-0.0.5}/src/potato_util.egg-info/requires.txt +0 -0
  40. {potato_util-0.0.4 → potato_util-0.0.5}/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.4
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
@@ -0,0 +1 @@
1
+ __version__ = "0.0.5"
@@ -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.4
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 +0,0 @@
1
- __version__ = "0.0.4"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes