absfuyu 5.0.0__py3-none-any.whl → 5.1.0__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.

Potentially problematic release.


This version of absfuyu might be problematic. Click here for more details.

Files changed (72) hide show
  1. absfuyu/__init__.py +1 -1
  2. absfuyu/__main__.py +2 -2
  3. absfuyu/cli/__init__.py +2 -2
  4. absfuyu/cli/color.py +30 -14
  5. absfuyu/cli/config_group.py +9 -2
  6. absfuyu/cli/do_group.py +13 -6
  7. absfuyu/cli/game_group.py +9 -2
  8. absfuyu/cli/tool_group.py +16 -9
  9. absfuyu/config/__init__.py +2 -2
  10. absfuyu/core/__init__.py +2 -2
  11. absfuyu/core/baseclass.py +449 -80
  12. absfuyu/core/baseclass2.py +2 -2
  13. absfuyu/core/decorator.py +69 -3
  14. absfuyu/core/docstring.py +25 -22
  15. absfuyu/core/dummy_cli.py +2 -2
  16. absfuyu/core/dummy_func.py +19 -6
  17. absfuyu/core/typings.py +40 -0
  18. absfuyu/dxt/__init__.py +2 -2
  19. absfuyu/dxt/dictext.py +2 -2
  20. absfuyu/dxt/dxt_support.py +2 -2
  21. absfuyu/dxt/intext.py +31 -3
  22. absfuyu/dxt/listext.py +28 -3
  23. absfuyu/dxt/strext.py +3 -3
  24. absfuyu/extra/__init__.py +2 -2
  25. absfuyu/extra/beautiful.py +3 -2
  26. absfuyu/extra/da/__init__.py +36 -0
  27. absfuyu/extra/da/dadf.py +1138 -0
  28. absfuyu/extra/da/dadf_base.py +186 -0
  29. absfuyu/extra/da/df_func.py +97 -0
  30. absfuyu/extra/da/mplt.py +219 -0
  31. absfuyu/extra/data_analysis.py +10 -1067
  32. absfuyu/fun/__init__.py +2 -2
  33. absfuyu/fun/tarot.py +2 -2
  34. absfuyu/game/__init__.py +2 -2
  35. absfuyu/game/game_stat.py +2 -2
  36. absfuyu/game/sudoku.py +2 -2
  37. absfuyu/game/tictactoe.py +2 -2
  38. absfuyu/game/wordle.py +2 -2
  39. absfuyu/general/__init__.py +4 -4
  40. absfuyu/general/content.py +2 -2
  41. absfuyu/general/human.py +2 -2
  42. absfuyu/general/shape.py +2 -2
  43. absfuyu/logger.py +2 -2
  44. absfuyu/pkg_data/__init__.py +2 -2
  45. absfuyu/pkg_data/deprecated.py +2 -2
  46. absfuyu/sort.py +2 -2
  47. absfuyu/tools/__init__.py +25 -2
  48. absfuyu/tools/checksum.py +27 -7
  49. absfuyu/tools/converter.py +93 -28
  50. absfuyu/{general → tools}/generator.py +2 -2
  51. absfuyu/tools/inspector.py +433 -0
  52. absfuyu/tools/keygen.py +2 -2
  53. absfuyu/tools/obfuscator.py +46 -8
  54. absfuyu/tools/passwordlib.py +88 -23
  55. absfuyu/tools/shutdownizer.py +2 -2
  56. absfuyu/tools/web.py +2 -2
  57. absfuyu/util/__init__.py +2 -2
  58. absfuyu/util/api.py +2 -2
  59. absfuyu/util/json_method.py +2 -2
  60. absfuyu/util/lunar.py +2 -2
  61. absfuyu/util/path.py +190 -82
  62. absfuyu/util/performance.py +4 -4
  63. absfuyu/util/shorten_number.py +40 -10
  64. absfuyu/util/text_table.py +272 -0
  65. absfuyu/util/zipped.py +6 -6
  66. absfuyu/version.py +59 -42
  67. {absfuyu-5.0.0.dist-info → absfuyu-5.1.0.dist-info}/METADATA +10 -3
  68. absfuyu-5.1.0.dist-info/RECORD +76 -0
  69. absfuyu-5.0.0.dist-info/RECORD +0 -68
  70. {absfuyu-5.0.0.dist-info → absfuyu-5.1.0.dist-info}/WHEEL +0 -0
  71. {absfuyu-5.0.0.dist-info → absfuyu-5.1.0.dist-info}/entry_points.txt +0 -0
  72. {absfuyu-5.0.0.dist-info → absfuyu-5.1.0.dist-info}/licenses/LICENSE +0 -0
absfuyu/fun/__init__.py CHANGED
@@ -3,8 +3,8 @@ Absfuyu: Fun
3
3
  ------------
4
4
  Some fun or weird stuff
5
5
 
6
- Version: 5.0.0
7
- Date updated: 13/02/2025 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
  """
9
9
 
10
10
  # Library
absfuyu/fun/tarot.py CHANGED
@@ -4,8 +4,8 @@ Absfuyu: Tarot
4
4
  Tarot stuff
5
5
 
6
6
 
7
- Version: 1.0.4
8
- Date updated: 14/11/2024 (dd/mm/yyyy)
7
+ Version: 5.1.0
8
+ Date updated: 10/03/2025 (dd/mm/yyyy)
9
9
 
10
10
  Usage:
11
11
  ------
absfuyu/game/__init__.py CHANGED
@@ -3,8 +3,8 @@ Absfuyu: Game
3
3
  -------------
4
4
  Contain some game that can be played on terminal
5
5
 
6
- Version: 1.1.0
7
- Date updated: 14/04/2024 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
  """
9
9
 
10
10
  # Module level
absfuyu/game/game_stat.py CHANGED
@@ -1,8 +1,8 @@
1
1
  """
2
2
  Game: Game Stat
3
3
 
4
- Version: 1.0.0
5
- Date updated: 14/04/2024 (dd/mm/yyyy)
4
+ Version: 5.1.0
5
+ Date updated: 10/03/2025 (dd/mm/yyyy)
6
6
  """
7
7
 
8
8
  # Module level
absfuyu/game/sudoku.py CHANGED
@@ -3,8 +3,8 @@ Game: Sudoku
3
3
  ------------
4
4
  Sudoku 9x9 Solver
5
5
 
6
- Version: 1.0.3
7
- Date updated: 15/11/2024 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
 
9
9
  Credit:
10
10
  -------
absfuyu/game/tictactoe.py CHANGED
@@ -2,8 +2,8 @@
2
2
  Game: Tic Tac Toe
3
3
  -----------------
4
4
 
5
- Version: 2.0.4
6
- Date updated: 15/11/2024 (dd/mm/yyyy)
5
+ Version: 5.1.0
6
+ Date updated: 10/03/2025 (dd/mm/yyyy)
7
7
  """
8
8
 
9
9
 
absfuyu/game/wordle.py CHANGED
@@ -2,8 +2,8 @@
2
2
  Game: Wordle Solver
3
3
  -------------------
4
4
 
5
- Version: 1.1.4
6
- Date updated: 14/04/2024 (dd/mm/yyyy)
5
+ Version: 5.1.0
6
+ Date updated: 10/03/2025 (dd/mm/yyyy)
7
7
 
8
8
  Usage:
9
9
  ------
@@ -3,8 +3,8 @@ Absfuyu: General
3
3
  ----------------
4
4
  Collection of useful classes
5
5
 
6
- Version: 1.1.4
7
- Date updated: 15/03/2024 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
 
9
9
  Features:
10
10
  ---------
@@ -15,9 +15,9 @@ Features:
15
15
 
16
16
  # Module level
17
17
  # ---------------------------------------------------------------------------
18
- __all__ = ["content", "generator", "human"]
18
+ __all__ = ["content", "shape", "human"]
19
19
 
20
20
 
21
21
  # Libary
22
22
  # ---------------------------------------------------------------------------
23
- from absfuyu.general import content, generator, human
23
+ from absfuyu.general import content, human, shape
@@ -3,8 +3,8 @@ Absfuyu: Content
3
3
  ----------------
4
4
  Handle .txt file
5
5
 
6
- Version: 1.2.6
7
- Date updated: 05/04/2024 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
 
9
9
  Usage:
10
10
  ------
absfuyu/general/human.py CHANGED
@@ -3,8 +3,8 @@ Absfuyu: Human
3
3
  --------------
4
4
  Human related stuff
5
5
 
6
- Version: 5.0.0
7
- Date updated: 25/02/2025 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
  """
9
9
 
10
10
  # Module level
absfuyu/general/shape.py CHANGED
@@ -3,8 +3,8 @@ Absfuyu: Shape
3
3
  --------------
4
4
  Shapes
5
5
 
6
- Version: 5.0.0
7
- Date updated: 19/02/2025 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
  """
9
9
 
10
10
  # Module level
absfuyu/logger.py CHANGED
@@ -3,8 +3,8 @@ Absfuyu: Logger
3
3
  ---------------
4
4
  Custom Logger Module
5
5
 
6
- Version: 1.3.2
7
- Date updated: 05/04/2024 (mm/dd/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
 
9
9
  Usage:
10
10
  ------
@@ -3,8 +3,8 @@ Absfuyu: Package data
3
3
  ---------------------
4
4
  Load package data
5
5
 
6
- Version: 5.0.0
7
- Date updated: 14/11/2024 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
  """
9
9
 
10
10
  # Module level
@@ -3,8 +3,8 @@ Absfuyu: Package data
3
3
  ---------------------
4
4
  Deprecated (but might have some use)
5
5
 
6
- Version: 2.2.3
7
- Date updated: 14/11/2024 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
  """
9
9
 
10
10
  # Library
absfuyu/sort.py CHANGED
@@ -3,8 +3,8 @@ Absfuyu: Sort
3
3
  -------------
4
4
  Sort Module
5
5
 
6
- Version: 1.3.0
7
- Date updated: 11/02/2025 (mm/dd/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
  """
9
9
 
10
10
  # Module level
absfuyu/tools/__init__.py CHANGED
@@ -3,6 +3,29 @@ Absfuyu: Tools
3
3
  --------------
4
4
  Some useful tools
5
5
 
6
- Version: 5.0.0
7
- Date updated: 15/02/2025 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
  """
9
+
10
+ # Module Package
11
+ # ---------------------------------------------------------------------------
12
+ __all__ = [
13
+ # Main
14
+ "Checksum",
15
+ "Base64EncodeDecode",
16
+ "Text2Chemistry",
17
+ "Charset",
18
+ "Generator",
19
+ "Inspector",
20
+ "Obfuscator",
21
+ "StrShifter",
22
+ ]
23
+
24
+
25
+ # Library
26
+ # ---------------------------------------------------------------------------
27
+ from absfuyu.tools.checksum import Checksum
28
+ from absfuyu.tools.converter import Base64EncodeDecode, Text2Chemistry
29
+ from absfuyu.tools.generator import Charset, Generator
30
+ from absfuyu.tools.inspector import Inspector
31
+ from absfuyu.tools.obfuscator import Obfuscator, StrShifter
absfuyu/tools/checksum.py CHANGED
@@ -3,8 +3,8 @@ Absufyu: Checksum
3
3
  -----------------
4
4
  Check MD5, SHA256, ...
5
5
 
6
- Version: 5.0.0
7
- Date updated: 13/02/2025 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
  """
9
9
 
10
10
  # Module level
@@ -19,7 +19,9 @@ from enum import StrEnum
19
19
  from pathlib import Path
20
20
  from typing import Literal
21
21
 
22
- from absfuyu.core import BaseClass, deprecated, tqdm, versionadded, versionchanged
22
+ from absfuyu.core.baseclass import BaseClass
23
+ from absfuyu.core.docstring import deprecated, versionadded, versionchanged
24
+ from absfuyu.core.dummy_func import tqdm
23
25
 
24
26
 
25
27
  # Function
@@ -65,6 +67,21 @@ class ChecksumMode(StrEnum):
65
67
  @versionchanged("4.1.1", reason="Checksum for entire folder is possible")
66
68
  @versionadded("4.1.0")
67
69
  class Checksum(BaseClass):
70
+ """
71
+ Checksum engine
72
+
73
+ Parameters
74
+ ----------
75
+ path : str | Path
76
+ Path to file/directory to perform checksum
77
+
78
+ hash_mode : ChecksumMode | Literal["md5", "sha1", "sha256", "sha512"], optional
79
+ Hash mode, by default ``"sha256"``
80
+
81
+ save_result_to_file : bool, optional
82
+ Save checksum result(s) to file, by default ``False``
83
+ """
84
+
68
85
  def __init__(
69
86
  self,
70
87
  path: str | Path,
@@ -73,7 +90,8 @@ class Checksum(BaseClass):
73
90
  ) = ChecksumMode.SHA256,
74
91
  save_result_to_file: bool = False,
75
92
  ) -> None:
76
- """Checksum engine
93
+ """
94
+ Checksum engine
77
95
 
78
96
  Parameters
79
97
  ----------
@@ -84,7 +102,7 @@ class Checksum(BaseClass):
84
102
  Hash mode, by default ``"sha256"``
85
103
 
86
104
  save_result_to_file : bool, optional
87
- Save checksum result(s) to file, by default False
105
+ Save checksum result(s) to file, by default ``False``
88
106
  """
89
107
  self.path = Path(path)
90
108
  self.hash_mode = hash_mode
@@ -125,12 +143,14 @@ class Checksum(BaseClass):
125
143
  return hash_engine.hexdigest() # type: ignore
126
144
 
127
145
  def checksum(self, recursive: bool = True) -> str:
128
- """Perform checksum
146
+ """
147
+ Perform checksum
129
148
 
130
149
  Parameters
131
150
  ----------
132
151
  recursive : bool, optional
133
- Do checksum for every file in the folder (including child folder), by default True
152
+ Do checksum for every file in the folder (including child folder),
153
+ by default ``True``
134
154
 
135
155
  Returns
136
156
  -------
@@ -3,8 +3,8 @@ Absufyu: Converter
3
3
  ------------------
4
4
  Convert stuff
5
5
 
6
- Version: 5.0.0
7
- Date updated: 11/02/2025 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
 
9
9
  Feature:
10
10
  --------
@@ -16,9 +16,9 @@ Feature:
16
16
  # Module level
17
17
  # ---------------------------------------------------------------------------
18
18
  __all__ = [
19
+ "Base64EncodeDecode",
19
20
  "Text2Chemistry",
20
21
  "Str2Pixel",
21
- "Base64EncodeDecode",
22
22
  ]
23
23
 
24
24
 
@@ -32,7 +32,8 @@ from itertools import chain, combinations
32
32
  from pathlib import Path
33
33
  from typing import Self
34
34
 
35
- from absfuyu.core import BaseClass, CLITextColor, versionadded
35
+ from absfuyu.core.baseclass import BaseClass, CLITextColor
36
+ from absfuyu.core.docstring import versionadded
36
37
  from absfuyu.logger import logger
37
38
  from absfuyu.pkg_data import DataList, DataLoader
38
39
  from absfuyu.util import set_min
@@ -84,14 +85,43 @@ class Base64EncodeDecode(BaseClass):
84
85
 
85
86
 
86
87
  class ChemistryElement(BaseClass):
87
- """Chemistry Element"""
88
+ """
89
+ Chemistry Element
90
+
91
+ Parameters
92
+ ----------
93
+ name : str
94
+ Element name
95
+
96
+ number : int
97
+ Order in periodic table
98
+
99
+ symbol : str
100
+ Short symbol of element
101
+
102
+ atomic_mass : float
103
+ Atomic mass of element
104
+ """
105
+
106
+ __slots__ = ("name", "number", "symbol", "atomic_mass")
88
107
 
89
108
  def __init__(self, name: str, number: int, symbol: str, atomic_mass: float) -> None:
90
109
  """
91
- name: element name
92
- number: order in periodic table
93
- symbol: short symbol of element
94
- atomic_mass: atomic mass of element
110
+ Chemistry Element
111
+
112
+ Parameters
113
+ ----------
114
+ name : str
115
+ Element name
116
+
117
+ number : int
118
+ Order in periodic table
119
+
120
+ symbol : str
121
+ Short symbol of element
122
+
123
+ atomic_mass : float
124
+ Atomic mass of element
95
125
  """
96
126
  self.name = name
97
127
  self.number = number
@@ -105,23 +135,28 @@ class ChemistryElement(BaseClass):
105
135
  """
106
136
  Output content to dict
107
137
 
108
- :rtype: dict[str, str | int | float]
138
+ Returns
139
+ -------
140
+ dict[str, str | int | float]
141
+ Dict version of element
109
142
  """
110
- return {
111
- "name": self.name,
112
- "number": self.number,
113
- "symbol": self.symbol,
114
- "atomic_mass": self.atomic_mass,
115
- }
143
+ # return {"name": self.name, "number": self.number, "symbol": self.symbol, "atomic_mass": self.atomic_mass}
144
+ return {x: getattr(self, x) for x in self.__slots__}
116
145
 
117
146
  @classmethod
118
147
  def from_dict(cls, data: dict[str, str | int | float]) -> Self:
119
148
  """
120
149
  Convert from ``dict`` data
121
150
 
122
- :param data: Dict data
123
- :type data: dict[str, str | int | float]
124
- :rtype: ChemistryElement
151
+ Parameters
152
+ ----------
153
+ data : dict[str, str | int | float]
154
+ Dict data
155
+
156
+ Returns
157
+ -------
158
+ Self
159
+ ChemistryElement
125
160
  """
126
161
  return cls(
127
162
  name=data["name"], # type: ignore
@@ -150,7 +185,10 @@ class Text2Chemistry(BaseClass):
150
185
  """
151
186
  Characters that can not be converted (unvailable chemistry symbol)
152
187
 
153
- :rtype: set[str]
188
+ Returns
189
+ -------
190
+ set[str]
191
+ Set of unvailable characters
154
192
  """
155
193
  base = set(string.ascii_lowercase)
156
194
  available = set(
@@ -164,10 +202,20 @@ class Text2Chemistry(BaseClass):
164
202
  """
165
203
  Convert text to chemistry symbol
166
204
 
167
- :param text: desired text
168
- :type text: str
169
- :returns: Converted text (empty list when failed to convert)
170
- :rtype: list
205
+ Parameters
206
+ ----------
207
+ text : str
208
+ Desired text
209
+
210
+ Returns
211
+ -------
212
+ list[list[ChemistryElement]] | list
213
+ Converted text (empty list when failed to convert)
214
+
215
+ Raises
216
+ ------
217
+ ValueError
218
+ When text contains digit, whitespaces, ...
171
219
  """
172
220
  # Check if `text` is a word (without digits)
173
221
  is_word_pattern = r"^[a-zA-Z]+$"
@@ -267,7 +315,21 @@ class Text2Chemistry(BaseClass):
267
315
 
268
316
 
269
317
  class Str2Pixel(BaseClass):
270
- """Convert str into pixel"""
318
+ """
319
+ Convert str into pixel
320
+
321
+ Parameters
322
+ ----------
323
+ str_data : str
324
+ | Pixel string data (Format: ``<number_of_pixel><color_code>``)
325
+ | Example: ``50w20b`` = 50 white pixels and 20 black pixels
326
+
327
+ pixel_size : int, optional
328
+ Pixel size, by default ``2``
329
+
330
+ pixel_symbol_overwrite : str | None, optional
331
+ Overwrite pixel symbol, by default ``None``
332
+ """
271
333
 
272
334
  PIXEL = "\u2588"
273
335
 
@@ -279,11 +341,13 @@ class Str2Pixel(BaseClass):
279
341
  pixel_symbol_overwrite: str | None = None,
280
342
  ) -> None:
281
343
  """
344
+ Convert str into pixel
345
+
282
346
  Parameters
283
347
  ----------
284
348
  str_data : str
285
- Pixel string data (Format: ``<number_of_pixel><color_code>``)
286
- Example: 50w20b = 50 white pixels and 20 black pixels
349
+ | Pixel string data (Format: ``<number_of_pixel><color_code>``)
350
+ | Example: ``50w20b`` = 50 white pixels and 20 black pixels
287
351
 
288
352
  pixel_size : int, optional
289
353
  Pixel size, by default ``2``
@@ -307,7 +371,8 @@ class Str2Pixel(BaseClass):
307
371
  return [x for y in zip(num, char) for x in y]
308
372
 
309
373
  def convert(self, line_break: bool = True) -> str:
310
- """Convert data into pixel
374
+ """
375
+ Convert data into pixel
311
376
 
312
377
  Parameters
313
378
  ----------
@@ -3,8 +3,8 @@ Absfuyu: Generator
3
3
  ------------------
4
4
  This generate stuff (Not python's ``generator``)
5
5
 
6
- Version: 5.0.0
7
- Date updated: 25/02/2025 (dd/mm/yyyy)
6
+ Version: 5.1.0
7
+ Date updated: 10/03/2025 (dd/mm/yyyy)
8
8
 
9
9
  Features:
10
10
  ---------