absfuyu 5.0.0__py3-none-any.whl → 6.1.2__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.
- absfuyu/__init__.py +5 -3
- absfuyu/__main__.py +3 -3
- absfuyu/cli/__init__.py +13 -2
- absfuyu/cli/audio_group.py +98 -0
- absfuyu/cli/color.py +30 -14
- absfuyu/cli/config_group.py +9 -2
- absfuyu/cli/do_group.py +23 -6
- absfuyu/cli/game_group.py +27 -2
- absfuyu/cli/tool_group.py +81 -11
- absfuyu/config/__init__.py +3 -3
- absfuyu/core/__init__.py +12 -8
- absfuyu/core/baseclass.py +929 -96
- absfuyu/core/baseclass2.py +44 -3
- absfuyu/core/decorator.py +70 -4
- absfuyu/core/docstring.py +64 -41
- absfuyu/core/dummy_cli.py +3 -3
- absfuyu/core/dummy_func.py +19 -6
- absfuyu/dxt/__init__.py +2 -2
- absfuyu/dxt/base_type.py +93 -0
- absfuyu/dxt/dictext.py +204 -16
- absfuyu/dxt/dxt_support.py +2 -2
- absfuyu/dxt/intext.py +151 -34
- absfuyu/dxt/listext.py +969 -127
- absfuyu/dxt/strext.py +77 -17
- absfuyu/extra/__init__.py +2 -2
- absfuyu/extra/audio/__init__.py +8 -0
- absfuyu/extra/audio/_util.py +57 -0
- absfuyu/extra/audio/convert.py +192 -0
- absfuyu/extra/audio/lossless.py +281 -0
- absfuyu/extra/beautiful.py +3 -2
- absfuyu/extra/da/__init__.py +72 -0
- absfuyu/extra/da/dadf.py +1600 -0
- absfuyu/extra/da/dadf_base.py +186 -0
- absfuyu/extra/da/df_func.py +181 -0
- absfuyu/extra/da/mplt.py +219 -0
- absfuyu/extra/ggapi/__init__.py +8 -0
- absfuyu/extra/ggapi/gdrive.py +223 -0
- absfuyu/extra/ggapi/glicense.py +148 -0
- absfuyu/extra/ggapi/glicense_df.py +186 -0
- absfuyu/extra/ggapi/gsheet.py +88 -0
- absfuyu/extra/img/__init__.py +30 -0
- absfuyu/extra/img/converter.py +402 -0
- absfuyu/extra/img/dup_check.py +291 -0
- absfuyu/extra/pdf.py +87 -0
- absfuyu/extra/rclone.py +253 -0
- absfuyu/extra/xml.py +90 -0
- absfuyu/fun/__init__.py +7 -20
- absfuyu/fun/rubik.py +442 -0
- absfuyu/fun/tarot.py +2 -2
- absfuyu/game/__init__.py +2 -2
- absfuyu/game/game_stat.py +2 -2
- absfuyu/game/schulte.py +78 -0
- absfuyu/game/sudoku.py +2 -2
- absfuyu/game/tictactoe.py +2 -3
- absfuyu/game/wordle.py +6 -4
- absfuyu/general/__init__.py +4 -4
- absfuyu/general/content.py +4 -4
- absfuyu/general/human.py +2 -2
- absfuyu/general/resrel.py +213 -0
- absfuyu/general/shape.py +3 -8
- absfuyu/general/tax.py +344 -0
- absfuyu/logger.py +806 -59
- absfuyu/numbers/__init__.py +13 -0
- absfuyu/numbers/number_to_word.py +321 -0
- absfuyu/numbers/shorten_number.py +303 -0
- absfuyu/numbers/time_duration.py +217 -0
- absfuyu/pkg_data/__init__.py +2 -2
- absfuyu/pkg_data/deprecated.py +2 -2
- absfuyu/pkg_data/logo.py +1462 -0
- absfuyu/sort.py +4 -4
- absfuyu/tools/__init__.py +28 -2
- absfuyu/tools/checksum.py +144 -9
- absfuyu/tools/converter.py +120 -34
- absfuyu/tools/generator.py +461 -0
- absfuyu/tools/inspector.py +752 -0
- absfuyu/tools/keygen.py +2 -2
- absfuyu/tools/obfuscator.py +47 -9
- absfuyu/tools/passwordlib.py +89 -25
- absfuyu/tools/shutdownizer.py +3 -8
- absfuyu/tools/sw.py +718 -0
- absfuyu/tools/web.py +10 -13
- absfuyu/typings.py +138 -0
- absfuyu/util/__init__.py +114 -6
- absfuyu/util/api.py +41 -18
- absfuyu/util/cli.py +119 -0
- absfuyu/util/gui.py +91 -0
- absfuyu/util/json_method.py +43 -14
- absfuyu/util/lunar.py +2 -2
- absfuyu/util/package.py +124 -0
- absfuyu/util/path.py +702 -82
- absfuyu/util/performance.py +122 -7
- absfuyu/util/shorten_number.py +244 -21
- absfuyu/util/text_table.py +481 -0
- absfuyu/util/zipped.py +8 -7
- absfuyu/version.py +79 -59
- {absfuyu-5.0.0.dist-info → absfuyu-6.1.2.dist-info}/METADATA +52 -11
- absfuyu-6.1.2.dist-info/RECORD +105 -0
- {absfuyu-5.0.0.dist-info → absfuyu-6.1.2.dist-info}/WHEEL +1 -1
- absfuyu/extra/data_analysis.py +0 -1078
- absfuyu/general/generator.py +0 -303
- absfuyu-5.0.0.dist-info/RECORD +0 -68
- {absfuyu-5.0.0.dist-info → absfuyu-6.1.2.dist-info}/entry_points.txt +0 -0
- {absfuyu-5.0.0.dist-info → absfuyu-6.1.2.dist-info}/licenses/LICENSE +0 -0
absfuyu/tools/keygen.py
CHANGED
absfuyu/tools/obfuscator.py
CHANGED
|
@@ -3,8 +3,8 @@ Absfuyu: Obfuscator
|
|
|
3
3
|
-------------------
|
|
4
4
|
Obfuscate code
|
|
5
5
|
|
|
6
|
-
Version:
|
|
7
|
-
Date updated:
|
|
6
|
+
Version: 6.1.1
|
|
7
|
+
Date updated: 30/12/2025 (dd/mm/yyyy)
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
10
|
# Module level
|
|
@@ -22,17 +22,28 @@ from collections import deque
|
|
|
22
22
|
from string import Template
|
|
23
23
|
from typing import ClassVar
|
|
24
24
|
|
|
25
|
-
from absfuyu.core import BaseClass,
|
|
25
|
+
from absfuyu.core.baseclass import BaseClass, GetClassMembersMixin
|
|
26
|
+
from absfuyu.core.docstring import versionadded
|
|
26
27
|
from absfuyu.dxt import Text
|
|
27
|
-
from absfuyu.general.generator import Charset, Generator
|
|
28
28
|
from absfuyu.logger import logger
|
|
29
|
+
from absfuyu.tools.generator import Charset, Generator
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
# Class
|
|
32
33
|
# ---------------------------------------------------------------------------
|
|
33
34
|
@versionadded("5.0.0")
|
|
34
35
|
class StrShifter(BaseClass):
|
|
35
|
-
"""
|
|
36
|
+
"""
|
|
37
|
+
Shift characters in a string by a specified number of positions.
|
|
38
|
+
|
|
39
|
+
Parameters
|
|
40
|
+
----------
|
|
41
|
+
str_to_shift : str
|
|
42
|
+
The string whose characters will be shifted.
|
|
43
|
+
|
|
44
|
+
shift_by : int, optional
|
|
45
|
+
The number of positions to shift the characters, by default ``5``.
|
|
46
|
+
"""
|
|
36
47
|
|
|
37
48
|
__slots__ = ("_str_to_shift", "shift_by")
|
|
38
49
|
|
|
@@ -99,8 +110,30 @@ class StrShifter(BaseClass):
|
|
|
99
110
|
return self._use_convert_table(self._make_convert_table())
|
|
100
111
|
|
|
101
112
|
|
|
102
|
-
class Obfuscator(
|
|
103
|
-
"""
|
|
113
|
+
class Obfuscator(GetClassMembersMixin):
|
|
114
|
+
"""
|
|
115
|
+
Obfuscate code
|
|
116
|
+
|
|
117
|
+
Parameters
|
|
118
|
+
----------
|
|
119
|
+
code : str
|
|
120
|
+
Code text
|
|
121
|
+
|
|
122
|
+
base64_only : bool, optional
|
|
123
|
+
- ``True``: encode in base64 form only
|
|
124
|
+
- ``False``: base64, compress, rot13 (default)
|
|
125
|
+
|
|
126
|
+
split_every : int, optional
|
|
127
|
+
Split the long line of code every ``x`` character.
|
|
128
|
+
Minimum is ``1``, by default ``60``
|
|
129
|
+
|
|
130
|
+
variable_length : int, optional
|
|
131
|
+
Length of variable name (when data string split).
|
|
132
|
+
Minimum is ``7``, by default ``12``
|
|
133
|
+
|
|
134
|
+
fake_data : bool, optional
|
|
135
|
+
Generate additional meaningless data, by default ``False``
|
|
136
|
+
"""
|
|
104
137
|
|
|
105
138
|
# Var
|
|
106
139
|
LIB_BASE64_ONLY: ClassVar[list[str]] = ["base64"]
|
|
@@ -219,8 +252,13 @@ class Obfuscator(ShowAllMethodsMixin):
|
|
|
219
252
|
"""
|
|
220
253
|
Convert text into base64 and then return a code that decode that base64 code
|
|
221
254
|
|
|
222
|
-
|
|
223
|
-
|
|
255
|
+
Parameters
|
|
256
|
+
----------
|
|
257
|
+
text : str
|
|
258
|
+
Code that need to convert
|
|
259
|
+
|
|
260
|
+
raw : bool
|
|
261
|
+
Return hex form only, by default ``False``
|
|
224
262
|
"""
|
|
225
263
|
b64_encode_codec = base64.b64encode(text.encode()).decode()
|
|
226
264
|
b64_decode_codec = f"base64.b64decode('{b64_encode_codec}'.encode()).decode()"
|
absfuyu/tools/passwordlib.py
CHANGED
|
@@ -3,13 +3,13 @@ Absfuyu: Passwordlib
|
|
|
3
3
|
--------------------
|
|
4
4
|
Password library
|
|
5
5
|
|
|
6
|
-
Version:
|
|
7
|
-
Date updated:
|
|
6
|
+
Version: 6.1.1
|
|
7
|
+
Date updated: 30/12/2025 (dd/mm/yyyy)
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
10
|
# Module level
|
|
11
11
|
# ---------------------------------------------------------------------------
|
|
12
|
-
__all__ = ["PasswordGenerator", "TOTP"]
|
|
12
|
+
__all__ = ["PasswordGenerator", "PasswordHash", "TOTP"]
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
# Library
|
|
@@ -21,12 +21,12 @@ import re
|
|
|
21
21
|
from typing import ClassVar, Literal, NamedTuple
|
|
22
22
|
from urllib.parse import quote, urlencode
|
|
23
23
|
|
|
24
|
-
from absfuyu.core import BaseClass
|
|
24
|
+
from absfuyu.core.baseclass import BaseClass
|
|
25
|
+
from absfuyu.core.docstring import deprecated, versionadded
|
|
25
26
|
from absfuyu.dxt import DictExt, Text
|
|
26
|
-
from absfuyu.general.generator import Charset, Generator
|
|
27
27
|
from absfuyu.logger import logger
|
|
28
28
|
from absfuyu.pkg_data import DataList, DataLoader
|
|
29
|
-
from absfuyu.
|
|
29
|
+
from absfuyu.tools.generator import Charset, Generator
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
# Function
|
|
@@ -88,6 +88,18 @@ def _password_check(password: str) -> bool:
|
|
|
88
88
|
# Class
|
|
89
89
|
# ---------------------------------------------------------------------------
|
|
90
90
|
class PasswordHash(NamedTuple):
|
|
91
|
+
"""
|
|
92
|
+
Password hash
|
|
93
|
+
|
|
94
|
+
Parameters
|
|
95
|
+
----------
|
|
96
|
+
salt : bytes
|
|
97
|
+
Salt
|
|
98
|
+
|
|
99
|
+
key : bytes
|
|
100
|
+
Key
|
|
101
|
+
"""
|
|
102
|
+
|
|
91
103
|
salt: bytes
|
|
92
104
|
key: bytes
|
|
93
105
|
|
|
@@ -102,7 +114,17 @@ class PasswordGenerator(BaseClass):
|
|
|
102
114
|
@staticmethod
|
|
103
115
|
def password_hash(password: str) -> PasswordHash:
|
|
104
116
|
"""
|
|
105
|
-
Generate hash for password
|
|
117
|
+
Generate hash for password.
|
|
118
|
+
|
|
119
|
+
Parameters
|
|
120
|
+
----------
|
|
121
|
+
password : str
|
|
122
|
+
Password string
|
|
123
|
+
|
|
124
|
+
Returns
|
|
125
|
+
-------
|
|
126
|
+
PasswordHash
|
|
127
|
+
Password hash contains salt and key
|
|
106
128
|
"""
|
|
107
129
|
salt = os.urandom(32)
|
|
108
130
|
key = hashlib.pbkdf2_hmac(
|
|
@@ -116,7 +138,19 @@ class PasswordGenerator(BaseClass):
|
|
|
116
138
|
|
|
117
139
|
@staticmethod
|
|
118
140
|
def password_check(password: str) -> dict:
|
|
119
|
-
"""
|
|
141
|
+
"""
|
|
142
|
+
Check password's characteristic.
|
|
143
|
+
|
|
144
|
+
Parameters
|
|
145
|
+
----------
|
|
146
|
+
password : str
|
|
147
|
+
Password string
|
|
148
|
+
|
|
149
|
+
Returns
|
|
150
|
+
-------
|
|
151
|
+
dict
|
|
152
|
+
Password's characteristic.
|
|
153
|
+
"""
|
|
120
154
|
data = Text(password).analyze()
|
|
121
155
|
data = DictExt(data).apply(lambda x: True if x > 0 else False) # type: ignore
|
|
122
156
|
data.__setitem__("length", len(password))
|
|
@@ -131,7 +165,7 @@ class PasswordGenerator(BaseClass):
|
|
|
131
165
|
include_special: bool = True,
|
|
132
166
|
) -> str:
|
|
133
167
|
r"""
|
|
134
|
-
Generate a random password
|
|
168
|
+
Generate a random password.
|
|
135
169
|
|
|
136
170
|
Parameters
|
|
137
171
|
----------
|
|
@@ -141,13 +175,13 @@ class PasswordGenerator(BaseClass):
|
|
|
141
175
|
| (Default: ``8``)
|
|
142
176
|
|
|
143
177
|
include_uppercase : bool
|
|
144
|
-
Include uppercase character in the password
|
|
178
|
+
Include uppercase character in the password, by default ``True``
|
|
145
179
|
|
|
146
180
|
include_number : bool
|
|
147
|
-
Include digit character in the password
|
|
181
|
+
Include digit character in the password, by default ``True``
|
|
148
182
|
|
|
149
183
|
include_special : bool
|
|
150
|
-
Include special character in the password
|
|
184
|
+
Include special character in the password, by default ``True``
|
|
151
185
|
|
|
152
186
|
Returns
|
|
153
187
|
-------
|
|
@@ -178,7 +212,7 @@ class PasswordGenerator(BaseClass):
|
|
|
178
212
|
while True:
|
|
179
213
|
pwd = Generator.generate_string(
|
|
180
214
|
charset=charset,
|
|
181
|
-
size=
|
|
215
|
+
size=max(length, 8), # type: ignore
|
|
182
216
|
times=1,
|
|
183
217
|
string_type_if_1=True,
|
|
184
218
|
)
|
|
@@ -205,16 +239,16 @@ class PasswordGenerator(BaseClass):
|
|
|
205
239
|
Parameters
|
|
206
240
|
----------
|
|
207
241
|
num_of_blocks : int
|
|
208
|
-
Number of word used
|
|
242
|
+
Number of word used, by default ``5``
|
|
209
243
|
|
|
210
244
|
block_divider : str
|
|
211
|
-
Character symbol that between each word
|
|
245
|
+
Character symbol that between each word, by default ``"-"``
|
|
212
246
|
|
|
213
247
|
first_letter_cap : bool
|
|
214
|
-
Capitalize first character of each word
|
|
248
|
+
Capitalize first character of each word, by default ``True``
|
|
215
249
|
|
|
216
250
|
include_number : bool
|
|
217
|
-
Add number to the end of each word
|
|
251
|
+
Add number to the end of each word, by default ``True``
|
|
218
252
|
|
|
219
253
|
custom_word_list : list[str] | None
|
|
220
254
|
Custom word list for passphrase generation, by default uses a list of 360K+ words
|
|
@@ -255,6 +289,33 @@ class PasswordGenerator(BaseClass):
|
|
|
255
289
|
class TOTP(BaseClass):
|
|
256
290
|
"""
|
|
257
291
|
A class to represent a Time-based One-Time Password (TOTP) generator.
|
|
292
|
+
|
|
293
|
+
Parameters
|
|
294
|
+
----------
|
|
295
|
+
secret : str
|
|
296
|
+
The shared secret key used to generate the TOTP.
|
|
297
|
+
|
|
298
|
+
name : str, optional
|
|
299
|
+
| The name associated with the TOTP.
|
|
300
|
+
| If not provided, by default ``"None"``.
|
|
301
|
+
|
|
302
|
+
issuer : str, optional
|
|
303
|
+
The issuer of the TOTP.
|
|
304
|
+
|
|
305
|
+
algorithm : Literal["SHA1", "SHA256", "SHA512"], optional
|
|
306
|
+
| The hashing algorithm used to generate the TOTP.
|
|
307
|
+
| Must be one of ``"SHA1"``, ``"SHA256"``, or ``"SHA512"``.
|
|
308
|
+
| By default ``"SHA1"``.
|
|
309
|
+
|
|
310
|
+
digit : int, optional
|
|
311
|
+
| The number of digits in the generated TOTP.
|
|
312
|
+
| Must be greater than 0.
|
|
313
|
+
| By default ``6``.
|
|
314
|
+
|
|
315
|
+
period : int, optional
|
|
316
|
+
| The time step in seconds for TOTP generation.
|
|
317
|
+
| Must be greater than 0.
|
|
318
|
+
| by default ``30``.
|
|
258
319
|
"""
|
|
259
320
|
|
|
260
321
|
URL_SCHEME: ClassVar[str] = "otpauth://totp/"
|
|
@@ -277,23 +338,26 @@ class TOTP(BaseClass):
|
|
|
277
338
|
The shared secret key used to generate the TOTP.
|
|
278
339
|
|
|
279
340
|
name : str, optional
|
|
280
|
-
The name associated with the TOTP.
|
|
341
|
+
| The name associated with the TOTP.
|
|
342
|
+
| If not provided, by default ``"None"``.
|
|
281
343
|
|
|
282
344
|
issuer : str, optional
|
|
283
345
|
The issuer of the TOTP.
|
|
284
346
|
|
|
285
347
|
algorithm : Literal["SHA1", "SHA256", "SHA512"], optional
|
|
286
|
-
The hashing algorithm used to generate the TOTP.
|
|
287
|
-
Must be one of ``"SHA1"``, ``"SHA256"``, or ``"SHA512"``.
|
|
288
|
-
|
|
348
|
+
| The hashing algorithm used to generate the TOTP.
|
|
349
|
+
| Must be one of ``"SHA1"``, ``"SHA256"``, or ``"SHA512"``.
|
|
350
|
+
| By default ``"SHA1"``.
|
|
289
351
|
|
|
290
352
|
digit : int, optional
|
|
291
|
-
The number of digits in the generated TOTP.
|
|
292
|
-
|
|
353
|
+
| The number of digits in the generated TOTP.
|
|
354
|
+
| Must be greater than 0.
|
|
355
|
+
| By default ``6``.
|
|
293
356
|
|
|
294
357
|
period : int, optional
|
|
295
|
-
The time step in seconds for TOTP generation.
|
|
296
|
-
|
|
358
|
+
| The time step in seconds for TOTP generation.
|
|
359
|
+
| Must be greater than 0.
|
|
360
|
+
| by default ``30``.
|
|
297
361
|
"""
|
|
298
362
|
self.secret = secret.upper()
|
|
299
363
|
self.name = name if name else "None"
|
absfuyu/tools/shutdownizer.py
CHANGED
|
@@ -3,8 +3,8 @@ Absfuyu: Shutdownizer
|
|
|
3
3
|
---------------------
|
|
4
4
|
This shutdowns
|
|
5
5
|
|
|
6
|
-
Version:
|
|
7
|
-
Date updated:
|
|
6
|
+
Version: 6.1.1
|
|
7
|
+
Date updated: 30/12/2025 (dd/mm/yyyy)
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
10
|
# Module level
|
|
@@ -20,12 +20,7 @@ import sys
|
|
|
20
20
|
from abc import ABC, abstractmethod
|
|
21
21
|
from datetime import datetime, time, timedelta
|
|
22
22
|
from pathlib import Path
|
|
23
|
-
from typing import Annotated
|
|
24
|
-
|
|
25
|
-
try:
|
|
26
|
-
from typing import override # type: ignore
|
|
27
|
-
except ImportError:
|
|
28
|
-
from absfuyu.core.decorator import dummy_decorator as override
|
|
23
|
+
from typing import Annotated, override
|
|
29
24
|
|
|
30
25
|
from absfuyu.core import BaseClass, versionadded, versionchanged
|
|
31
26
|
from absfuyu.logger import logger
|