absfuyu 3.2.0__py3-none-any.whl → 3.4.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.
- absfuyu/__init__.py +3 -10
- absfuyu/__main__.py +5 -250
- absfuyu/cli/__init__.py +51 -0
- absfuyu/cli/color.py +24 -0
- absfuyu/cli/config_group.py +56 -0
- absfuyu/cli/do_group.py +98 -0
- absfuyu/cli/game_group.py +109 -0
- absfuyu/config/__init__.py +55 -94
- absfuyu/config/config.json +0 -7
- absfuyu/core.py +5 -66
- absfuyu/everything.py +7 -9
- absfuyu/extensions/beautiful.py +30 -23
- absfuyu/extensions/dev/__init__.py +11 -8
- absfuyu/extensions/dev/password_hash.py +4 -2
- absfuyu/extensions/dev/passwordlib.py +7 -5
- absfuyu/extensions/dev/project_starter.py +4 -2
- absfuyu/extensions/dev/shutdownizer.py +148 -0
- absfuyu/extensions/extra/__init__.py +1 -2
- absfuyu/extensions/extra/data_analysis.py +110 -58
- absfuyu/fun/WGS.py +50 -26
- absfuyu/fun/__init__.py +6 -7
- absfuyu/fun/tarot.py +1 -1
- absfuyu/game/__init__.py +75 -81
- absfuyu/game/game_stat.py +36 -0
- absfuyu/game/sudoku.py +41 -48
- absfuyu/game/tictactoe.py +303 -548
- absfuyu/game/wordle.py +56 -47
- absfuyu/general/__init__.py +17 -7
- absfuyu/general/content.py +16 -15
- absfuyu/general/data_extension.py +314 -109
- absfuyu/general/generator.py +67 -67
- absfuyu/general/human.py +148 -78
- absfuyu/logger.py +94 -68
- absfuyu/pkg_data/__init__.py +29 -25
- absfuyu/py.typed +0 -0
- absfuyu/sort.py +61 -47
- absfuyu/tools/__init__.py +0 -1
- absfuyu/tools/converter.py +80 -62
- absfuyu/tools/keygen.py +62 -67
- absfuyu/tools/obfuscator.py +57 -53
- absfuyu/tools/stats.py +24 -24
- absfuyu/tools/web.py +10 -9
- absfuyu/util/__init__.py +38 -40
- absfuyu/util/api.py +53 -43
- absfuyu/util/json_method.py +25 -27
- absfuyu/util/lunar.py +20 -24
- absfuyu/util/path.py +362 -241
- absfuyu/util/performance.py +36 -98
- absfuyu/util/pkl.py +8 -8
- absfuyu/util/zipped.py +17 -19
- absfuyu/version.py +137 -148
- absfuyu-3.4.0.dist-info/METADATA +124 -0
- absfuyu-3.4.0.dist-info/RECORD +59 -0
- {absfuyu-3.2.0.dist-info → absfuyu-3.4.0.dist-info}/WHEEL +1 -2
- {absfuyu-3.2.0.dist-info → absfuyu-3.4.0.dist-info}/entry_points.txt +1 -0
- {absfuyu-3.2.0.dist-info → absfuyu-3.4.0.dist-info/licenses}/LICENSE +1 -1
- absfuyu/extensions/dev/pkglib.py +0 -98
- absfuyu/game/tictactoe2.py +0 -318
- absfuyu-3.2.0.dist-info/METADATA +0 -216
- absfuyu-3.2.0.dist-info/RECORD +0 -55
- absfuyu-3.2.0.dist-info/top_level.txt +0 -1
absfuyu/version.py
CHANGED
|
@@ -3,16 +3,11 @@ Absfuyu: Version
|
|
|
3
3
|
----------------
|
|
4
4
|
Package versioning module
|
|
5
5
|
|
|
6
|
-
Version: 2.
|
|
7
|
-
Date updated: 14/
|
|
6
|
+
Version: 2.1.1
|
|
7
|
+
Date updated: 14/04/2024 (dd/mm/yyyy)
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
# Module level
|
|
12
|
-
###########################################################################
|
|
13
10
|
__all__ = [
|
|
14
|
-
# Version
|
|
15
|
-
"__version__",
|
|
16
11
|
# Options
|
|
17
12
|
"ReleaseOption",
|
|
18
13
|
"ReleaseLevel",
|
|
@@ -22,21 +17,17 @@ __all__ = [
|
|
|
22
17
|
"PkgVersion",
|
|
23
18
|
]
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
###########################################################################
|
|
20
|
+
|
|
27
21
|
import json
|
|
22
|
+
import re
|
|
28
23
|
import subprocess
|
|
29
|
-
from typing import List
|
|
24
|
+
from typing import List, Tuple, TypedDict, Union
|
|
30
25
|
from urllib.error import URLError
|
|
31
26
|
from urllib.request import Request, urlopen
|
|
32
27
|
|
|
33
|
-
from absfuyu import __title__
|
|
34
|
-
from absfuyu.config import ABSFUYU_CONFIG, Config
|
|
35
28
|
from absfuyu.logger import logger
|
|
36
29
|
|
|
37
30
|
|
|
38
|
-
# Class
|
|
39
|
-
###########################################################################
|
|
40
31
|
class ReleaseOption:
|
|
41
32
|
"""
|
|
42
33
|
``MAJOR``, ``MINOR``, ``PATCH``
|
|
@@ -46,10 +37,9 @@ class ReleaseOption:
|
|
|
46
37
|
MINOR: str = "minor"
|
|
47
38
|
PATCH: str = "patch"
|
|
48
39
|
|
|
49
|
-
#
|
|
50
|
-
def all_option() -> List[str]:
|
|
40
|
+
def all_option() -> List[str]: # type: ignore
|
|
51
41
|
"""Return a list of release options"""
|
|
52
|
-
return [__class__.MAJOR, __class__.MINOR, __class__.PATCH]
|
|
42
|
+
return [__class__.MAJOR, __class__.MINOR, __class__.PATCH] # type: ignore
|
|
53
43
|
|
|
54
44
|
|
|
55
45
|
class ReleaseLevel:
|
|
@@ -61,10 +51,27 @@ class ReleaseLevel:
|
|
|
61
51
|
DEV: str = "dev"
|
|
62
52
|
RC: str = "rc" # Release candidate
|
|
63
53
|
|
|
64
|
-
#
|
|
65
|
-
def all_level() -> List[str]:
|
|
54
|
+
def all_level() -> List[str]: # type: ignore
|
|
66
55
|
"""Return a list of release levels"""
|
|
67
|
-
return [__class__.FINAL, __class__.DEV, __class__.RC]
|
|
56
|
+
return [__class__.FINAL, __class__.DEV, __class__.RC] # type: ignore
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class VersionDictFormat(TypedDict):
|
|
60
|
+
"""
|
|
61
|
+
Format for the ``version`` section in ``config``
|
|
62
|
+
|
|
63
|
+
:param major: Major changes
|
|
64
|
+
:param minor: Minor changes
|
|
65
|
+
:param patch: Patches and fixes
|
|
66
|
+
:param release_level: Release level
|
|
67
|
+
:param serial: Release serial
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
major: int
|
|
71
|
+
minor: int
|
|
72
|
+
patch: int
|
|
73
|
+
release_level: str
|
|
74
|
+
serial: int
|
|
68
75
|
|
|
69
76
|
|
|
70
77
|
class Version:
|
|
@@ -72,31 +79,31 @@ class Version:
|
|
|
72
79
|
|
|
73
80
|
def __init__(
|
|
74
81
|
self,
|
|
75
|
-
major: int,
|
|
76
|
-
minor: int,
|
|
77
|
-
patch: int,
|
|
82
|
+
major: Union[int, str],
|
|
83
|
+
minor: Union[int, str],
|
|
84
|
+
patch: Union[int, str],
|
|
78
85
|
release_level: str = ReleaseLevel.FINAL,
|
|
79
|
-
serial: int = 0,
|
|
86
|
+
serial: Union[int, str] = 0,
|
|
80
87
|
) -> None:
|
|
81
88
|
"""
|
|
82
89
|
Create ``Version`` instance
|
|
83
90
|
|
|
84
91
|
:param major: Major change
|
|
85
|
-
:type major: int
|
|
92
|
+
:type major: int | str
|
|
86
93
|
:param minor: Minor change
|
|
87
|
-
:type minor: int
|
|
94
|
+
:type minor: int | str
|
|
88
95
|
:param patch: Patch
|
|
89
|
-
:type patch: int
|
|
96
|
+
:type patch: int | str
|
|
90
97
|
:param release_level: Release level: ``final``|``rc``|``dev``
|
|
91
98
|
:type release_level: str
|
|
92
99
|
:param serial: Serial for release level ``rc``|``dev``
|
|
93
|
-
:type serial: int
|
|
100
|
+
:type serial: int | str
|
|
94
101
|
"""
|
|
95
|
-
self.major: int = major
|
|
96
|
-
self.minor: int = minor
|
|
97
|
-
self.patch: int = patch
|
|
102
|
+
self.major: int = major if isinstance(major, int) else int(major)
|
|
103
|
+
self.minor: int = minor if isinstance(minor, int) else int(minor)
|
|
104
|
+
self.patch: int = patch if isinstance(patch, int) else int(patch)
|
|
98
105
|
self.release_level: str = release_level
|
|
99
|
-
self.serial: int = serial
|
|
106
|
+
self.serial: int = serial if isinstance(serial, int) else int(serial)
|
|
100
107
|
|
|
101
108
|
def __str__(self) -> str:
|
|
102
109
|
return self.version
|
|
@@ -105,7 +112,11 @@ class Version:
|
|
|
105
112
|
if self.release_level.startswith(ReleaseLevel.FINAL):
|
|
106
113
|
return f"{self.__class__.__name__}(major={self.major}, minor={self.minor}, patch={self.patch})"
|
|
107
114
|
else:
|
|
108
|
-
return
|
|
115
|
+
return (
|
|
116
|
+
f"{self.__class__.__name__}("
|
|
117
|
+
f"major={self.major}, minor={self.minor}, patch={self.patch}, "
|
|
118
|
+
f"release_level={self.release_level}, serial={self.serial})"
|
|
119
|
+
)
|
|
109
120
|
|
|
110
121
|
def __format__(self, format_spec: str) -> str:
|
|
111
122
|
"""
|
|
@@ -127,7 +138,7 @@ class Version:
|
|
|
127
138
|
# Logic
|
|
128
139
|
if format_spec.lower().startswith("full"):
|
|
129
140
|
return f"{self.major}.{self.minor}.{self.patch}.{self.release_level}{self.serial}"
|
|
130
|
-
|
|
141
|
+
|
|
131
142
|
# Else
|
|
132
143
|
return self.__str__()
|
|
133
144
|
|
|
@@ -154,15 +165,27 @@ class Version:
|
|
|
154
165
|
return f"{self.major}.{self.minor}.{self.patch}.{self.release_level}{self.serial}"
|
|
155
166
|
|
|
156
167
|
@classmethod
|
|
157
|
-
def from_tuple(
|
|
168
|
+
def from_tuple(
|
|
169
|
+
cls, iterable: Union[Tuple[int, int, int], Tuple[int, int, int, str, int]]
|
|
170
|
+
):
|
|
158
171
|
"""
|
|
159
172
|
Convert to ``Version`` from a ``tuple``
|
|
160
173
|
|
|
174
|
+
Parameters
|
|
175
|
+
----------
|
|
176
|
+
iterable : tuple[int, int, int] | tuple[int, int, int, str, int]
|
|
177
|
+
Version tuple in correct format
|
|
178
|
+
|
|
161
179
|
Returns
|
|
162
180
|
-------
|
|
163
181
|
Version
|
|
164
182
|
Version
|
|
165
183
|
|
|
184
|
+
Raises
|
|
185
|
+
------
|
|
186
|
+
ValueError
|
|
187
|
+
Wrong tuple format
|
|
188
|
+
|
|
166
189
|
|
|
167
190
|
Example:
|
|
168
191
|
--------
|
|
@@ -179,12 +202,58 @@ class Version:
|
|
|
179
202
|
else:
|
|
180
203
|
raise ValueError("iterable must have len of 5 or 3")
|
|
181
204
|
|
|
182
|
-
|
|
205
|
+
@classmethod
|
|
206
|
+
def from_str(cls, version_string: str):
|
|
207
|
+
"""
|
|
208
|
+
Convert to ``Version`` from a ``str``
|
|
209
|
+
|
|
210
|
+
Parameters
|
|
211
|
+
----------
|
|
212
|
+
version_string : str
|
|
213
|
+
| Version str in correct format
|
|
214
|
+
| ``<major>.<minor>.<patch>``
|
|
215
|
+
| ``<major>.<minor>.<patch>.<release level><serial>``
|
|
216
|
+
|
|
217
|
+
Returns
|
|
218
|
+
-------
|
|
219
|
+
Version
|
|
220
|
+
Version
|
|
221
|
+
|
|
222
|
+
Raises
|
|
223
|
+
------
|
|
224
|
+
ValueError
|
|
225
|
+
Wrong version_string format
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
Example:
|
|
229
|
+
--------
|
|
230
|
+
>>> test = Version.from_str("1.0.0")
|
|
231
|
+
>>> test.version
|
|
232
|
+
1.0.0
|
|
233
|
+
"""
|
|
234
|
+
short_ver_pattern = re.compile(r"\b(\d)+\.(\d+)\.(\d+)\b")
|
|
235
|
+
long_ver_pattern = re.compile(r"\b(\d)+\.(\d+)\.(\d+)\.(dev|rc|final)(\d+)\b")
|
|
236
|
+
ver = version_string.lower().strip()
|
|
237
|
+
|
|
238
|
+
long_ver = re.search(long_ver_pattern, ver)
|
|
239
|
+
if long_ver:
|
|
240
|
+
return cls.from_tuple(long_ver.groups()) # type: ignore
|
|
241
|
+
|
|
242
|
+
short_ver = re.search(short_ver_pattern, ver)
|
|
243
|
+
if short_ver:
|
|
244
|
+
return cls.from_tuple(short_ver.groups()) # type: ignore
|
|
245
|
+
|
|
246
|
+
raise ValueError("Wrong version_string format")
|
|
247
|
+
|
|
248
|
+
def to_dict(self) -> VersionDictFormat:
|
|
183
249
|
"""
|
|
184
250
|
Convert ``Version`` into ``dict``
|
|
185
251
|
|
|
186
|
-
|
|
187
|
-
|
|
252
|
+
Returns
|
|
253
|
+
-------
|
|
254
|
+
VersionDictFormat
|
|
255
|
+
Version dict
|
|
256
|
+
|
|
188
257
|
|
|
189
258
|
Example:
|
|
190
259
|
--------
|
|
@@ -198,13 +267,14 @@ class Version:
|
|
|
198
267
|
"serial": 0
|
|
199
268
|
}
|
|
200
269
|
"""
|
|
201
|
-
|
|
270
|
+
out: VersionDictFormat = {
|
|
202
271
|
"major": self.major,
|
|
203
272
|
"minor": self.minor,
|
|
204
273
|
"patch": self.patch,
|
|
205
274
|
"release_level": self.release_level,
|
|
206
275
|
"serial": self.serial,
|
|
207
276
|
}
|
|
277
|
+
return out
|
|
208
278
|
|
|
209
279
|
|
|
210
280
|
class Bumper(Version):
|
|
@@ -214,7 +284,6 @@ class Bumper(Version):
|
|
|
214
284
|
"""
|
|
215
285
|
Bumping major, minor, patch
|
|
216
286
|
"""
|
|
217
|
-
logger.debug(f"Before: {self.version}")
|
|
218
287
|
|
|
219
288
|
if release_option.startswith(ReleaseOption.MAJOR):
|
|
220
289
|
self.major += 1
|
|
@@ -226,8 +295,6 @@ class Bumper(Version):
|
|
|
226
295
|
else:
|
|
227
296
|
self.patch += 1
|
|
228
297
|
|
|
229
|
-
logger.debug(f"After: {self.version}")
|
|
230
|
-
|
|
231
298
|
def bump(
|
|
232
299
|
self, *, option: str = ReleaseOption.PATCH, channel: str = ReleaseLevel.FINAL
|
|
233
300
|
) -> None:
|
|
@@ -256,10 +323,10 @@ class Bumper(Version):
|
|
|
256
323
|
"""
|
|
257
324
|
# Check conditions - use default values if fail
|
|
258
325
|
if option not in ReleaseOption.all_option():
|
|
259
|
-
logger.
|
|
326
|
+
logger.warning(f"Available option: {ReleaseOption.all_option()}")
|
|
260
327
|
option = ReleaseOption.PATCH
|
|
261
328
|
if channel not in ReleaseLevel.all_level():
|
|
262
|
-
logger.
|
|
329
|
+
logger.warning(f"Available level: {ReleaseLevel.all_level()}")
|
|
263
330
|
channel = ReleaseLevel.FINAL
|
|
264
331
|
logger.debug(f"Target: {option} {channel}")
|
|
265
332
|
|
|
@@ -297,33 +364,12 @@ class Bumper(Version):
|
|
|
297
364
|
self._bump_ver(option)
|
|
298
365
|
|
|
299
366
|
|
|
300
|
-
class PkgVersion
|
|
367
|
+
class PkgVersion:
|
|
301
368
|
"""
|
|
302
|
-
|
|
369
|
+
Package Version
|
|
303
370
|
"""
|
|
304
371
|
|
|
305
|
-
def __init__(self, package_name: str
|
|
306
|
-
"""
|
|
307
|
-
package_name: Name of the package
|
|
308
|
-
config_file_handler: Config file handler
|
|
309
|
-
"""
|
|
310
|
-
|
|
311
|
-
# Get config
|
|
312
|
-
try:
|
|
313
|
-
self.config_file = config_file_handler
|
|
314
|
-
version: dict = self.config_file.version
|
|
315
|
-
except Exception as e:
|
|
316
|
-
logger.error("Can't load config file")
|
|
317
|
-
raise ValueError(e)
|
|
318
|
-
|
|
319
|
-
# Set version
|
|
320
|
-
self.major: int = version.get("major")
|
|
321
|
-
self.minor: int = version.get("minor")
|
|
322
|
-
self.patch: int = version.get("patch")
|
|
323
|
-
self.release_level: str = version.get("release_level")
|
|
324
|
-
self.serial: int = version.get("serial")
|
|
325
|
-
|
|
326
|
-
# Set package name
|
|
372
|
+
def __init__(self, package_name: str) -> None:
|
|
327
373
|
self.package_name = package_name
|
|
328
374
|
|
|
329
375
|
# Check for update
|
|
@@ -341,7 +387,7 @@ class PkgVersion(Bumper):
|
|
|
341
387
|
elif hasattr(e, "code"):
|
|
342
388
|
logger.error("The server couldn't fulfill the request.")
|
|
343
389
|
logger.error("Error code: ", e.code)
|
|
344
|
-
except:
|
|
390
|
+
except Exception:
|
|
345
391
|
logger.error("Fetch failed!")
|
|
346
392
|
else:
|
|
347
393
|
return response.read().decode()
|
|
@@ -352,8 +398,16 @@ class PkgVersion(Bumper):
|
|
|
352
398
|
"""
|
|
353
399
|
rss = f"https://pypi.org/rss/project/{self.package_name}/releases.xml"
|
|
354
400
|
xml_file: str = self._fetch_data_from_server(rss)
|
|
355
|
-
ver = xml_file[
|
|
356
|
-
|
|
401
|
+
ver = xml_file[
|
|
402
|
+
xml_file.find("<item>") : xml_file.find(
|
|
403
|
+
"</item>"
|
|
404
|
+
) # noqa: E203
|
|
405
|
+
] # First item
|
|
406
|
+
version = ver[
|
|
407
|
+
ver.find("<title>") + len("<title>") : ver.find(
|
|
408
|
+
"</title>"
|
|
409
|
+
) # noqa: E203
|
|
410
|
+
]
|
|
357
411
|
return version
|
|
358
412
|
|
|
359
413
|
def _load_data_from_json(self, json_link: str) -> dict:
|
|
@@ -361,7 +415,7 @@ class PkgVersion(Bumper):
|
|
|
361
415
|
Load data from api then convert to json
|
|
362
416
|
"""
|
|
363
417
|
json_file: str = self._fetch_data_from_server(json_link)
|
|
364
|
-
return json.loads(json_file)
|
|
418
|
+
return json.loads(json_file) # type: ignore
|
|
365
419
|
|
|
366
420
|
def _get_latest_version(self) -> str:
|
|
367
421
|
"""
|
|
@@ -393,9 +447,17 @@ class PkgVersion(Bumper):
|
|
|
393
447
|
|
|
394
448
|
try:
|
|
395
449
|
latest = self._get_latest_version()
|
|
396
|
-
except:
|
|
450
|
+
except Exception:
|
|
397
451
|
latest = self._get_latest_version_legacy()
|
|
398
|
-
|
|
452
|
+
|
|
453
|
+
try:
|
|
454
|
+
import importlib
|
|
455
|
+
|
|
456
|
+
_pk = importlib.__import__(self.package_name)
|
|
457
|
+
current: str = _pk.__version__
|
|
458
|
+
except Exception:
|
|
459
|
+
current = ""
|
|
460
|
+
|
|
399
461
|
logger.debug(f"Current: {current} | Lastest: {latest}")
|
|
400
462
|
|
|
401
463
|
if current == latest:
|
|
@@ -405,7 +467,7 @@ class PkgVersion(Bumper):
|
|
|
405
467
|
print(f"Newer version ({latest}) available. Upgrading...")
|
|
406
468
|
try:
|
|
407
469
|
self._get_update()
|
|
408
|
-
except:
|
|
470
|
+
except Exception:
|
|
409
471
|
print(
|
|
410
472
|
f"""
|
|
411
473
|
Unable to perform update.
|
|
@@ -417,76 +479,3 @@ class PkgVersion(Bumper):
|
|
|
417
479
|
print(
|
|
418
480
|
f"Newer version ({latest}) available. Upgrade with:\npip install -U {self.package_name}=={latest}"
|
|
419
481
|
)
|
|
420
|
-
|
|
421
|
-
# Bump version
|
|
422
|
-
def bump_version(
|
|
423
|
-
self, option: str = ReleaseOption.PATCH, channel: str = ReleaseLevel.FINAL
|
|
424
|
-
) -> str:
|
|
425
|
-
"""
|
|
426
|
-
Bump current version and save
|
|
427
|
-
|
|
428
|
-
Parameters
|
|
429
|
-
----------
|
|
430
|
-
option : str
|
|
431
|
-
Release option
|
|
432
|
-
(Default: ``"patch"``)
|
|
433
|
-
|
|
434
|
-
channel : str
|
|
435
|
-
Release channel
|
|
436
|
-
(Default: ``"final"``)
|
|
437
|
-
|
|
438
|
-
Returns
|
|
439
|
-
-------
|
|
440
|
-
str
|
|
441
|
-
Bumped version string
|
|
442
|
-
"""
|
|
443
|
-
self.bump(option=option, channel=channel) # Bump
|
|
444
|
-
self.config_file.update_version(self.to_dict()) # Save to config
|
|
445
|
-
return self.version
|
|
446
|
-
|
|
447
|
-
# Release package
|
|
448
|
-
def _release_to_pypi(
|
|
449
|
-
self,
|
|
450
|
-
option: str = ReleaseOption.PATCH,
|
|
451
|
-
channel: str = ReleaseLevel.FINAL,
|
|
452
|
-
safety_lock_off: bool = False,
|
|
453
|
-
) -> None:
|
|
454
|
-
"""
|
|
455
|
-
Developer only! Not intended for end-user
|
|
456
|
-
|
|
457
|
-
option: ReleaseOption
|
|
458
|
-
channel: ReleaseLevel
|
|
459
|
-
safety_lock_off: Set to `True` to execute this function
|
|
460
|
-
"""
|
|
461
|
-
if not safety_lock_off:
|
|
462
|
-
return None
|
|
463
|
-
|
|
464
|
-
logger.debug("Bumping version...")
|
|
465
|
-
|
|
466
|
-
self.bump_version(option=option, channel=channel)
|
|
467
|
-
|
|
468
|
-
logger.debug(f"Version bumped. Current verion: {self.version}")
|
|
469
|
-
logger.debug("Building package...")
|
|
470
|
-
|
|
471
|
-
try:
|
|
472
|
-
cmds = ["python -m build".split(), "twine upload dist/*".split()]
|
|
473
|
-
for cmd in cmds:
|
|
474
|
-
subprocess.run(cmd)
|
|
475
|
-
logger.debug("Release published!")
|
|
476
|
-
except Exception as e:
|
|
477
|
-
logger.error(f"Release failed!\n\n{e}")
|
|
478
|
-
return None
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
# Init
|
|
482
|
-
###########################################################################
|
|
483
|
-
_AbsfuyuPackage = PkgVersion(package_name=__title__, config_file_handler=ABSFUYU_CONFIG)
|
|
484
|
-
# global __version__
|
|
485
|
-
__version__ = str(_AbsfuyuPackage)
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
# Run
|
|
489
|
-
###########################################################################
|
|
490
|
-
if __name__ == "__main__":
|
|
491
|
-
logger.setLevel(10)
|
|
492
|
-
print(__version__)
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: absfuyu
|
|
3
|
+
Version: 3.4.0
|
|
4
|
+
Summary: A small collection of code
|
|
5
|
+
Project-URL: Homepage, https://github.com/AbsoluteWinter/absfuyu-public
|
|
6
|
+
Project-URL: Documentation, https://absolutewinter.github.io/absfuyu-docs/
|
|
7
|
+
Project-URL: Repository, https://github.com/AbsoluteWinter/absfuyu-public
|
|
8
|
+
Project-URL: Issues, https://github.com/AbsoluteWinter/absfuyu-public/issues
|
|
9
|
+
Author: somewhatcold (AbsoluteWinter)
|
|
10
|
+
License: MIT License
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: utilities
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Natural Language :: English
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
|
+
Classifier: Topic :: Utilities
|
|
29
|
+
Requires-Python: <4,>=3.8
|
|
30
|
+
Requires-Dist: bs4
|
|
31
|
+
Requires-Dist: click>=8.0.0
|
|
32
|
+
Requires-Dist: colorama
|
|
33
|
+
Requires-Dist: deprecated
|
|
34
|
+
Requires-Dist: importlib-resources; python_version < '3.10'
|
|
35
|
+
Requires-Dist: python-dateutil
|
|
36
|
+
Requires-Dist: requests
|
|
37
|
+
Requires-Dist: tomli>=1.1.0; python_version < '3.11'
|
|
38
|
+
Requires-Dist: typing-extensions>=4.0.1; python_version < '3.11'
|
|
39
|
+
Requires-Dist: unidecode
|
|
40
|
+
Provides-Extra: beautiful
|
|
41
|
+
Requires-Dist: rich; extra == 'beautiful'
|
|
42
|
+
Provides-Extra: dev
|
|
43
|
+
Requires-Dist: hatch; extra == 'dev'
|
|
44
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
45
|
+
Provides-Extra: extra
|
|
46
|
+
Requires-Dist: numpy; extra == 'extra'
|
|
47
|
+
Requires-Dist: pandas; extra == 'extra'
|
|
48
|
+
Provides-Extra: full
|
|
49
|
+
Requires-Dist: absfuyu-res; extra == 'full'
|
|
50
|
+
Requires-Dist: numpy; extra == 'full'
|
|
51
|
+
Requires-Dist: pandas; extra == 'full'
|
|
52
|
+
Requires-Dist: rich; extra == 'full'
|
|
53
|
+
Provides-Extra: res
|
|
54
|
+
Requires-Dist: absfuyu-res; extra == 'res'
|
|
55
|
+
Description-Content-Type: text/markdown
|
|
56
|
+
|
|
57
|
+
<div align="center">
|
|
58
|
+
<h1 align="center">
|
|
59
|
+
<img src="https://github.com/AbsoluteWinter/AbsoluteWinter.github.io/blob/main/absfuyu/images/repository-image-crop.png?raw=true" alt="absfuyu"/>
|
|
60
|
+
</h1>
|
|
61
|
+
<p align="center">
|
|
62
|
+
<a href="https://pypi.org/project/absfuyu/"><img src="https://img.shields.io/pypi/pyversions/absfuyu?style=flat-square&logo=python" alt="PyPI Supported Versions"/></a>
|
|
63
|
+
<a href="https://pypi.org/project/absfuyu/"><img src="https://img.shields.io/pypi/dm/absfuyu?style=flat-square&color=blue" alt="PyPI Downloads"/></a>
|
|
64
|
+
<a href="https://pypi.org/project/absfuyu/"><img src="https://img.shields.io/pypi/v/absfuyu?style=flat-square&logo=pypi" /></a>
|
|
65
|
+
<a><img src="https://img.shields.io/pypi/l/absfuyu?style=flat-square&logo=github&color=blue"/></a>
|
|
66
|
+
<a><img src="https://img.shields.io/badge/code%20style-black-black?style=flat-square"/></a>
|
|
67
|
+
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&style=flat-square" alt="Ruff" style="max-width:100%;"></a>
|
|
68
|
+
</p>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## **SUMMARY:**
|
|
75
|
+
|
|
76
|
+
*TL;DR: A collection of code*
|
|
77
|
+
|
|
78
|
+
## **INSTALLATION:**
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
$ pip install -U absfuyu
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## **USAGE:**
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
import absfuyu
|
|
88
|
+
help(absfuyu)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## **DOCUMENTATION:**
|
|
92
|
+
|
|
93
|
+
> [here](https://absolutewinter.github.io/absfuyu/)
|
|
94
|
+
|
|
95
|
+
## **DEV SETUP**
|
|
96
|
+
|
|
97
|
+
1. Create virtual environment
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
python -m venv env
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Note: Might need to run this in powershell (windows)
|
|
104
|
+
|
|
105
|
+
```powershell
|
|
106
|
+
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
2. Install required packages
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
python -m pip install -e .[full,dev]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
3. Getting info of dev environment
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
hatch env show
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## **LICENSE:**
|
|
123
|
+
|
|
124
|
+
MIT License
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
absfuyu/__init__.py,sha256=_yzkAdSotbRg7ZyL2DwGHvhipMMNblfJPmT9ApkUZsI,638
|
|
2
|
+
absfuyu/__main__.py,sha256=OpMwc35W5VANzw6gvlqJaJOl2H89i_frFZbleUQwDss,163
|
|
3
|
+
absfuyu/core.py,sha256=HYEbVQ_zKFyMje6pwssw53RojT1RwMjZsA0F6jInxMg,1248
|
|
4
|
+
absfuyu/everything.py,sha256=PGIXlqgxyADFPygohVYVIb7fZz72L_xXrlLX0WImuYg,788
|
|
5
|
+
absfuyu/logger.py,sha256=vT0CniqNv-cNXbtkhu1jaOhehHvlInHQt1PFsna5qIY,13135
|
|
6
|
+
absfuyu/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
absfuyu/sort.py,sha256=Z9nK15WehmZjlUNwvAOwF4FhV-rFcqlXkCcehNYmo78,6827
|
|
8
|
+
absfuyu/version.py,sha256=KMaeXNl93L4VU2RnTySoFv23IDyTvHfy84nyatFcKaE,14128
|
|
9
|
+
absfuyu/cli/__init__.py,sha256=nKTbe4iPpkjtDDMJwVY36heInKDm1zyek9ags5an7s4,1105
|
|
10
|
+
absfuyu/cli/color.py,sha256=7M3XqFllt26tv_NR5qKgyTId6wnVADtUB74cDYy8pOQ,497
|
|
11
|
+
absfuyu/cli/config_group.py,sha256=FsyYm2apSyAA2PAD12CpHAizenRds_QlLf8j0AlLuVo,1230
|
|
12
|
+
absfuyu/cli/do_group.py,sha256=HUXmlx11fSrcq4BwAhxDvQXSj6IPiwt4f2OlVR6sFjM,2343
|
|
13
|
+
absfuyu/cli/game_group.py,sha256=ySpL2hm4VCplhNY0s22kBGI5eFCdJj9fm1T58yftU74,2348
|
|
14
|
+
absfuyu/config/__init__.py,sha256=Rowa9XlSQiXVRdbL_6wOh7eWAm1jyPG4sPn_WjBj8D0,8650
|
|
15
|
+
absfuyu/config/config.json,sha256=-ZQnmDuLq0aAFfsrQbSNR3tq5k9Eu9IVUQgYD9htIQM,646
|
|
16
|
+
absfuyu/extensions/__init__.py,sha256=hxeZm3w00K4GC78cDTIo5ROWiWAZw4zEmlevfOqbNvo,146
|
|
17
|
+
absfuyu/extensions/beautiful.py,sha256=eGfmJ72UQTVvevMCr80RoyYuCYxLaHkvAm1Kk2pkqc0,5331
|
|
18
|
+
absfuyu/extensions/dev/__init__.py,sha256=sr80dV4a2gktP3GhAYHQdFM5vDkXyTsSi74yCbnLc0E,6534
|
|
19
|
+
absfuyu/extensions/dev/password_hash.py,sha256=AO8VSW9s9VyrTCGgrN-HLqYIUWAYFSds6vLYrhH-ako,1826
|
|
20
|
+
absfuyu/extensions/dev/passwordlib.py,sha256=RvN-AOYann_K-OXVJOmtfTi38uYlcr7Gd2OnGe0I1og,6812
|
|
21
|
+
absfuyu/extensions/dev/project_starter.py,sha256=RkTHwMXdChB45d7rrDuDMzo3a34-P514JlOmYHHNads,1593
|
|
22
|
+
absfuyu/extensions/dev/shutdownizer.py,sha256=Vm9AUsUGyvRWRYAl4fp4CriSmixzBtV8ZGvqmNjdEvo,4027
|
|
23
|
+
absfuyu/extensions/extra/__init__.py,sha256=gUB8fIOz4V9xQxk689dMe7NFFu_r-CneCsi32DtjQAo,552
|
|
24
|
+
absfuyu/extensions/extra/data_analysis.py,sha256=CyAv-bLevoUDzpnULWP_b_I1_QGWK6DQa7pI6k8WBVQ,31695
|
|
25
|
+
absfuyu/fun/WGS.py,sha256=Aug9BsLTawBDkjdCQ3oqWAfGGeY6ZSBV1kENrTVnlUA,9461
|
|
26
|
+
absfuyu/fun/__init__.py,sha256=dkJ59Ci0_ncwfKUbY_HL862GwfDpKlcMKMMLbGXnbbU,6273
|
|
27
|
+
absfuyu/fun/tarot.py,sha256=ZHRuqclhSeTjolIqgl1D85e5QSwhxUSYWCqtQEyMHsA,2570
|
|
28
|
+
absfuyu/game/__init__.py,sha256=p3aHtyYgT1joM5Q596ycrU8vOpCahEOCkOQdJAH5iAU,4417
|
|
29
|
+
absfuyu/game/game_stat.py,sha256=4limsvYGw_t2PMZXrGfivouc4SDexFcc9f3SjXGVj_o,961
|
|
30
|
+
absfuyu/game/sudoku.py,sha256=RVjo3maXukxf6Og1MbALasN48uXNraMd2KcGhfgc9G8,10141
|
|
31
|
+
absfuyu/game/tictactoe.py,sha256=WeWbRTWPsKl_NXdxuL2h5f9Bu8zMvkRxwIf4VIeAiAA,9609
|
|
32
|
+
absfuyu/game/wordle.py,sha256=1RpgB8fBgcL_E2TgbTFXjZHtzthJQysCAl0fbK_LG5w,101336
|
|
33
|
+
absfuyu/general/__init__.py,sha256=6AJZ7Ul6l8MKaqEwRD2ktQUIBfhTPaDUYDQB7MUQ5rc,2481
|
|
34
|
+
absfuyu/general/content.py,sha256=7yhl-6Rhyp2geNpuKQkuhxor3EcyovW3COdiYsmjUDI,17441
|
|
35
|
+
absfuyu/general/data_extension.py,sha256=4jSND6dzLqoQD3LkskxdslTxDMD-scgekgHBfJNOIlQ,49378
|
|
36
|
+
absfuyu/general/generator.py,sha256=pozKlZgTqKxzwsKR6-tI8Lel0qTjTMubv4T3Zk7ifEQ,9691
|
|
37
|
+
absfuyu/general/human.py,sha256=drZT1nI_YwGMOwZu8pbzf3frM-SUY15cOcnUpc4pzQk,12241
|
|
38
|
+
absfuyu/pkg_data/__init__.py,sha256=nqlQFF05sgnpPJYbac7gdUULPNy9PUVhW_KL8vGBqhQ,5000
|
|
39
|
+
absfuyu/pkg_data/chemistry.pkl,sha256=kYWNa_PVffoDnzT8b9Jvimmf_GZshPe1D-SnEKERsLo,4655
|
|
40
|
+
absfuyu/pkg_data/tarot.pkl,sha256=ssXTCC_BQgslO5F-3a9HivbxFQ6BioIe2E1frPVi2m0,56195
|
|
41
|
+
absfuyu/tools/__init__.py,sha256=VDmmMLEfiRyUWPVrPYc8JUEa5TXjLguKVnyI3YavFv0,118
|
|
42
|
+
absfuyu/tools/converter.py,sha256=9fbFpzxOmY44YDi_5S6CtcQPebeY-9wFeZ9057cJWeY,9925
|
|
43
|
+
absfuyu/tools/keygen.py,sha256=drj8OUDCXrLvcVf9_Shd5UMShm_mBTxa9Sg_BrAT5yM,7356
|
|
44
|
+
absfuyu/tools/obfuscator.py,sha256=c1HMEg40BY9XM_dHK1mokjHE9Sp5Vd083oFxvPnFrKA,8666
|
|
45
|
+
absfuyu/tools/stats.py,sha256=zZNK59qn0xqQlyw5CP3MP5WRMSxncdKZythqvgNR1lQ,5191
|
|
46
|
+
absfuyu/tools/web.py,sha256=Mb5RYj1Fu5eB-mYMusyrE2JG6_ZPEf8WT72Z8q6Ep74,1406
|
|
47
|
+
absfuyu/util/__init__.py,sha256=PMdzc23qt18hRBEc1vF5S2dStbLX8UqiIac_DH27Fac,3821
|
|
48
|
+
absfuyu/util/api.py,sha256=a7HvcNyRNgggUqyssYsggC8-1qofmVvFeRcOmLPQSqI,4427
|
|
49
|
+
absfuyu/util/json_method.py,sha256=7Qtdrf_Wh1qVswwHEdqGe0Zw3s_UYyBrpw8SGF7RVwI,2721
|
|
50
|
+
absfuyu/util/lunar.py,sha256=B7Xola5m8fNNAbqpsbLLJzAj8Z0HYT2EbNq-sYPPdl8,13804
|
|
51
|
+
absfuyu/util/path.py,sha256=_eeroXaHiJTzIyhX65b-gkMQ4tiHjKT_ZFHLFoHCzlo,16620
|
|
52
|
+
absfuyu/util/performance.py,sha256=vOSlMmKIT_LLM5Dey3ra-iLLEaW5SsBzIR5-dovzB0w,9142
|
|
53
|
+
absfuyu/util/pkl.py,sha256=ZZf6-PFC2uRGXqARNi0PGH3A0IXwMP0sYPWZJXENvak,1559
|
|
54
|
+
absfuyu/util/zipped.py,sha256=C0T2XRJcRPqoUiKBbViY2IgFI_47tdGMT9WXLxK1DeM,2570
|
|
55
|
+
absfuyu-3.4.0.dist-info/METADATA,sha256=PFKTz0flBfAbXRFCZHcssanawKuqT7BULYqD6t1VWPA,3969
|
|
56
|
+
absfuyu-3.4.0.dist-info/WHEEL,sha256=xl5aZkiJYVTjhVaiADvIe6UeUVylGNomrxKZ0Zda1CE,87
|
|
57
|
+
absfuyu-3.4.0.dist-info/entry_points.txt,sha256=bW5CgJRTTWJ2Pywojo07sf-YucRPcnHzMmETh5avbX0,79
|
|
58
|
+
absfuyu-3.4.0.dist-info/licenses/LICENSE,sha256=_tQM-uZht2y-26_MHcIasBp8gtJ2YmvLOezIbhixrAA,1076
|
|
59
|
+
absfuyu-3.4.0.dist-info/RECORD,,
|