absfuyu 4.2.0__py3-none-any.whl → 5.0.1__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 +4 -4
- absfuyu/__main__.py +13 -1
- absfuyu/cli/__init__.py +2 -2
- absfuyu/cli/color.py +9 -2
- absfuyu/cli/config_group.py +2 -2
- absfuyu/cli/do_group.py +2 -37
- absfuyu/cli/game_group.py +2 -2
- absfuyu/cli/tool_group.py +7 -7
- absfuyu/config/__init__.py +17 -34
- absfuyu/core/__init__.py +49 -0
- absfuyu/core/baseclass.py +299 -0
- absfuyu/core/baseclass2.py +165 -0
- absfuyu/core/decorator.py +67 -0
- absfuyu/core/docstring.py +166 -0
- absfuyu/core/dummy_cli.py +67 -0
- absfuyu/core/dummy_func.py +49 -0
- absfuyu/dxt/__init__.py +42 -0
- absfuyu/dxt/dictext.py +201 -0
- absfuyu/dxt/dxt_support.py +79 -0
- absfuyu/dxt/intext.py +586 -0
- absfuyu/dxt/listext.py +508 -0
- absfuyu/dxt/strext.py +530 -0
- absfuyu/extra/__init__.py +12 -0
- absfuyu/extra/beautiful.py +252 -0
- absfuyu/{extensions → extra}/data_analysis.py +51 -82
- absfuyu/fun/__init__.py +110 -135
- absfuyu/fun/tarot.py +11 -19
- absfuyu/game/__init__.py +8 -2
- absfuyu/game/game_stat.py +8 -2
- absfuyu/game/sudoku.py +9 -3
- absfuyu/game/tictactoe.py +14 -7
- absfuyu/game/wordle.py +16 -10
- absfuyu/general/__init__.py +8 -81
- absfuyu/general/content.py +24 -38
- absfuyu/general/human.py +108 -228
- absfuyu/general/shape.py +1334 -0
- absfuyu/logger.py +10 -15
- absfuyu/pkg_data/__init__.py +137 -100
- absfuyu/pkg_data/deprecated.py +133 -0
- absfuyu/sort.py +6 -130
- absfuyu/tools/__init__.py +2 -2
- absfuyu/tools/checksum.py +33 -22
- absfuyu/tools/converter.py +51 -48
- absfuyu/{general → tools}/generator.py +17 -42
- absfuyu/tools/keygen.py +25 -30
- absfuyu/tools/obfuscator.py +246 -112
- absfuyu/tools/passwordlib.py +100 -30
- absfuyu/tools/shutdownizer.py +68 -47
- absfuyu/tools/web.py +4 -11
- absfuyu/util/__init__.py +17 -17
- absfuyu/util/api.py +10 -15
- absfuyu/util/json_method.py +7 -24
- absfuyu/util/lunar.py +5 -11
- absfuyu/util/path.py +22 -27
- absfuyu/util/performance.py +43 -67
- absfuyu/util/shorten_number.py +65 -14
- absfuyu/util/zipped.py +11 -17
- absfuyu/version.py +59 -42
- {absfuyu-4.2.0.dist-info → absfuyu-5.0.1.dist-info}/METADATA +41 -14
- absfuyu-5.0.1.dist-info/RECORD +68 -0
- absfuyu/core.py +0 -57
- absfuyu/everything.py +0 -32
- absfuyu/extensions/__init__.py +0 -12
- absfuyu/extensions/beautiful.py +0 -188
- absfuyu/fun/WGS.py +0 -134
- absfuyu/general/data_extension.py +0 -1796
- absfuyu/tools/stats.py +0 -226
- absfuyu/util/pkl.py +0 -67
- absfuyu-4.2.0.dist-info/RECORD +0 -59
- {absfuyu-4.2.0.dist-info → absfuyu-5.0.1.dist-info}/WHEEL +0 -0
- {absfuyu-4.2.0.dist-info → absfuyu-5.0.1.dist-info}/entry_points.txt +0 -0
- {absfuyu-4.2.0.dist-info → absfuyu-5.0.1.dist-info}/licenses/LICENSE +0 -0
absfuyu/version.py
CHANGED
|
@@ -3,10 +3,12 @@ Absfuyu: Version
|
|
|
3
3
|
----------------
|
|
4
4
|
Package versioning module
|
|
5
5
|
|
|
6
|
-
Version:
|
|
7
|
-
Date updated:
|
|
6
|
+
Version: 5.0.0
|
|
7
|
+
Date updated: 25/02/2025 (dd/mm/yyyy)
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
+
# Module level
|
|
11
|
+
# ---------------------------------------------------------------------------
|
|
10
12
|
__all__ = [
|
|
11
13
|
# Options
|
|
12
14
|
"ReleaseOption",
|
|
@@ -18,42 +20,50 @@ __all__ = [
|
|
|
18
20
|
]
|
|
19
21
|
|
|
20
22
|
|
|
23
|
+
# Library
|
|
24
|
+
# ---------------------------------------------------------------------------
|
|
21
25
|
import json
|
|
22
26
|
import re
|
|
23
27
|
import subprocess
|
|
24
|
-
from
|
|
28
|
+
from enum import StrEnum
|
|
29
|
+
from typing import Self, TypedDict
|
|
25
30
|
from urllib.error import URLError
|
|
26
31
|
from urllib.request import Request, urlopen
|
|
27
32
|
|
|
33
|
+
from absfuyu.core import BaseClass
|
|
28
34
|
from absfuyu.logger import logger
|
|
29
35
|
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
# Class
|
|
38
|
+
# ---------------------------------------------------------------------------
|
|
39
|
+
class ReleaseOption(StrEnum):
|
|
32
40
|
"""
|
|
33
41
|
``MAJOR``, ``MINOR``, ``PATCH``
|
|
34
42
|
"""
|
|
35
43
|
|
|
36
|
-
MAJOR
|
|
37
|
-
MINOR
|
|
38
|
-
PATCH
|
|
44
|
+
MAJOR = "major"
|
|
45
|
+
MINOR = "minor"
|
|
46
|
+
PATCH = "patch"
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
@classmethod
|
|
49
|
+
def all_option(cls) -> list[str]:
|
|
41
50
|
"""Return a list of release options"""
|
|
42
|
-
return [
|
|
51
|
+
return [cls.MAJOR.value, cls.MINOR.value, cls.PATCH.value]
|
|
43
52
|
|
|
44
53
|
|
|
45
|
-
class ReleaseLevel:
|
|
54
|
+
class ReleaseLevel(StrEnum):
|
|
46
55
|
"""
|
|
47
56
|
``FINAL``, ``DEV``, ``RC``
|
|
48
57
|
"""
|
|
49
58
|
|
|
50
|
-
FINAL
|
|
51
|
-
DEV
|
|
52
|
-
RC
|
|
59
|
+
FINAL = "final"
|
|
60
|
+
DEV = "dev"
|
|
61
|
+
RC = "rc" # Release candidate
|
|
53
62
|
|
|
54
|
-
|
|
63
|
+
@classmethod
|
|
64
|
+
def all_level(cls) -> list[str]:
|
|
55
65
|
"""Return a list of release levels"""
|
|
56
|
-
return [
|
|
66
|
+
return [cls.FINAL.value, cls.DEV.value, cls.RC.value]
|
|
57
67
|
|
|
58
68
|
|
|
59
69
|
class VersionDictFormat(TypedDict):
|
|
@@ -74,30 +84,36 @@ class VersionDictFormat(TypedDict):
|
|
|
74
84
|
serial: int
|
|
75
85
|
|
|
76
86
|
|
|
77
|
-
class Version:
|
|
87
|
+
class Version(BaseClass):
|
|
78
88
|
"""Version"""
|
|
79
89
|
|
|
80
90
|
def __init__(
|
|
81
91
|
self,
|
|
82
|
-
major:
|
|
83
|
-
minor:
|
|
84
|
-
patch:
|
|
92
|
+
major: int | str,
|
|
93
|
+
minor: int | str,
|
|
94
|
+
patch: int | str,
|
|
85
95
|
release_level: str = ReleaseLevel.FINAL,
|
|
86
|
-
serial:
|
|
96
|
+
serial: int | str = 0,
|
|
87
97
|
) -> None:
|
|
88
98
|
"""
|
|
89
99
|
Create ``Version`` instance
|
|
90
100
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
Parameters
|
|
102
|
+
----------
|
|
103
|
+
major : int | str
|
|
104
|
+
Major change
|
|
105
|
+
|
|
106
|
+
minor : int | str
|
|
107
|
+
Minor change
|
|
108
|
+
|
|
109
|
+
patch : int | str
|
|
110
|
+
Patch
|
|
111
|
+
|
|
112
|
+
release_level : str, optional
|
|
113
|
+
Release level: ``final`` | ``rc`` | ``dev``, by default ``ReleaseLevel.FINAL``
|
|
114
|
+
|
|
115
|
+
serial : int | str, optional
|
|
116
|
+
Serial for release level ``rc`` | ``dev``, by default ``0``
|
|
101
117
|
"""
|
|
102
118
|
self.major: int = major if isinstance(major, int) else int(major)
|
|
103
119
|
self.minor: int = minor if isinstance(minor, int) else int(minor)
|
|
@@ -108,15 +124,16 @@ class Version:
|
|
|
108
124
|
def __str__(self) -> str:
|
|
109
125
|
return self.version
|
|
110
126
|
|
|
111
|
-
def __repr__(self) -> str:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
127
|
+
# def __repr__(self) -> str:
|
|
128
|
+
# cls_name = self.__class__.__name__
|
|
129
|
+
# if self.release_level.startswith(ReleaseLevel.FINAL):
|
|
130
|
+
# return f"{cls_name}(major={self.major}, minor={self.minor}, patch={self.patch})"
|
|
131
|
+
# else:
|
|
132
|
+
# return (
|
|
133
|
+
# f"{cls_name}("
|
|
134
|
+
# f"major={self.major}, minor={self.minor}, patch={self.patch}, "
|
|
135
|
+
# f"release_level={self.release_level}, serial={self.serial})"
|
|
136
|
+
# )
|
|
120
137
|
|
|
121
138
|
def __format__(self, format_spec: str) -> str:
|
|
122
139
|
"""
|
|
@@ -166,8 +183,8 @@ class Version:
|
|
|
166
183
|
|
|
167
184
|
@classmethod
|
|
168
185
|
def from_tuple(
|
|
169
|
-
cls, iterable:
|
|
170
|
-
):
|
|
186
|
+
cls, iterable: tuple[int, int, int] | tuple[int, int, int, str, int]
|
|
187
|
+
) -> Self:
|
|
171
188
|
"""
|
|
172
189
|
Convert to ``Version`` from a ``tuple``
|
|
173
190
|
|
|
@@ -203,7 +220,7 @@ class Version:
|
|
|
203
220
|
raise ValueError("iterable must have len of 5 or 3")
|
|
204
221
|
|
|
205
222
|
@classmethod
|
|
206
|
-
def from_str(cls, version_string: str):
|
|
223
|
+
def from_str(cls, version_string: str) -> Self:
|
|
207
224
|
"""
|
|
208
225
|
Convert to ``Version`` from a ``str``
|
|
209
226
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: absfuyu
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0.1
|
|
4
4
|
Summary: A small collection of code
|
|
5
5
|
Project-URL: Homepage, https://github.com/AbsoluteWinter/absfuyu-public
|
|
6
6
|
Project-URL: Documentation, https://absolutewinter.github.io/absfuyu-docs/
|
|
7
7
|
Project-URL: Repository, https://github.com/AbsoluteWinter/absfuyu-public
|
|
8
8
|
Project-URL: Issues, https://github.com/AbsoluteWinter/absfuyu-public/issues
|
|
9
9
|
Author: somewhatcold (AbsoluteWinter)
|
|
10
|
-
License: MIT
|
|
10
|
+
License-Expression: MIT
|
|
11
11
|
License-File: LICENSE
|
|
12
12
|
Keywords: utilities
|
|
13
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
@@ -28,16 +28,16 @@ Requires-Python: <4,>=3.11
|
|
|
28
28
|
Requires-Dist: bs4
|
|
29
29
|
Requires-Dist: click>=8.0.0
|
|
30
30
|
Requires-Dist: colorama
|
|
31
|
-
Requires-Dist: deprecated
|
|
32
|
-
Requires-Dist: python-dateutil
|
|
33
31
|
Requires-Dist: requests
|
|
34
|
-
Requires-Dist: typing-extensions>=4.5.0; python_version < '3.12'
|
|
35
|
-
Requires-Dist: unidecode
|
|
36
32
|
Provides-Extra: beautiful
|
|
37
33
|
Requires-Dist: rich; extra == 'beautiful'
|
|
38
34
|
Provides-Extra: dev
|
|
39
35
|
Requires-Dist: hatch; extra == 'dev'
|
|
40
36
|
Requires-Dist: pytest; extra == 'dev'
|
|
37
|
+
Provides-Extra: docs
|
|
38
|
+
Requires-Dist: numpy; extra == 'docs'
|
|
39
|
+
Requires-Dist: pandas; extra == 'docs'
|
|
40
|
+
Requires-Dist: rich; extra == 'docs'
|
|
41
41
|
Provides-Extra: extra
|
|
42
42
|
Requires-Dist: numpy; extra == 'extra'
|
|
43
43
|
Requires-Dist: pandas; extra == 'extra'
|
|
@@ -46,6 +46,7 @@ Requires-Dist: numpy; extra == 'full'
|
|
|
46
46
|
Requires-Dist: pandas; extra == 'full'
|
|
47
47
|
Requires-Dist: rich; extra == 'full'
|
|
48
48
|
Requires-Dist: tqdm; extra == 'full'
|
|
49
|
+
Requires-Dist: unidecode; extra == 'full'
|
|
49
50
|
Description-Content-Type: text/markdown
|
|
50
51
|
|
|
51
52
|
<div align="center">
|
|
@@ -66,10 +67,12 @@ Description-Content-Type: text/markdown
|
|
|
66
67
|
|
|
67
68
|
## **SUMMARY:**
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
This project is a collection of code primarily developed as a personal hobby. It aims to provide practical experience and enhance my coding skills while exploring potential future applications.
|
|
70
71
|
|
|
71
72
|
## **INSTALLATION:**
|
|
72
73
|
|
|
74
|
+
To install the package, run the following command:
|
|
75
|
+
|
|
73
76
|
```bash
|
|
74
77
|
pip install -U absfuyu
|
|
75
78
|
```
|
|
@@ -81,31 +84,55 @@ import absfuyu
|
|
|
81
84
|
help(absfuyu)
|
|
82
85
|
```
|
|
83
86
|
|
|
87
|
+
### Notable features
|
|
88
|
+
|
|
89
|
+
**absfuyu.core**: Provides foundational components for additional functionalities.
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
# Decorators that adds info to __doc__
|
|
93
|
+
from absfuyu.core.docstring import versionadded, versionchanged, deprecated
|
|
94
|
+
|
|
95
|
+
# Class mixins for enhanced functionality
|
|
96
|
+
from absfuyu.core.baseclass import AutoREPRMixin, ShowAllMethodsMixin
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**absfuyu.dxt**: Extension for `list`, `str`, `dict`, `int`.
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from absfuyu.dxt import DictExt, IntExt, ListExt, Text
|
|
103
|
+
for x in [DictExt, IntExt, ListExt, Text]:
|
|
104
|
+
x.show_all_methods(print_result=1)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
There are many additional features available to explore.
|
|
108
|
+
|
|
84
109
|
## **DOCUMENTATION:**
|
|
85
110
|
|
|
86
|
-
|
|
111
|
+
For more detailed information about the project, please refer to the documentation available at the following link:
|
|
112
|
+
|
|
113
|
+
> [Project Documentation](https://absolutewinter.github.io/absfuyu-docs/)
|
|
87
114
|
|
|
88
|
-
## **
|
|
115
|
+
## **DEVELOPMENT SETUP**
|
|
89
116
|
|
|
90
|
-
1. Create
|
|
117
|
+
1. Create a Virtual Environment
|
|
91
118
|
|
|
92
119
|
```bash
|
|
93
120
|
python -m venv env
|
|
94
121
|
```
|
|
95
122
|
|
|
96
|
-
Note:
|
|
123
|
+
Note: You may need to execute this command in PowerShell on Windows:
|
|
97
124
|
|
|
98
125
|
```powershell
|
|
99
126
|
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
|
|
100
127
|
```
|
|
101
128
|
|
|
102
|
-
2. Install
|
|
129
|
+
2. Install Required Packages
|
|
103
130
|
|
|
104
131
|
```bash
|
|
105
132
|
python -m pip install -e .[full,dev]
|
|
106
133
|
```
|
|
107
134
|
|
|
108
|
-
3.
|
|
135
|
+
3. Acquire Information About the Development Environment Configuration
|
|
109
136
|
|
|
110
137
|
```bash
|
|
111
138
|
hatch env show
|
|
@@ -113,4 +140,4 @@ hatch env show
|
|
|
113
140
|
|
|
114
141
|
## **LICENSE:**
|
|
115
142
|
|
|
116
|
-
MIT License
|
|
143
|
+
This project is licensed under the MIT License.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
absfuyu/__init__.py,sha256=pDzdGzKO07dKGuByDoOGJGxanWFB9XKqTNY0BunlEyU,600
|
|
2
|
+
absfuyu/__main__.py,sha256=9bLz3WK0oG0jGTLE9pd3e3j3ldVaCfO2dsLFNneJ6fU,603
|
|
3
|
+
absfuyu/logger.py,sha256=zEu8Px0kCmdeMtawf8UWb_fwff1_ZG45U0iUjI6g9GU,13043
|
|
4
|
+
absfuyu/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
absfuyu/sort.py,sha256=BsXuDMuO-Q6hUZwmFspyLo5jc7rxgBFSdektIlVJ0BQ,3250
|
|
6
|
+
absfuyu/version.py,sha256=Smkc97D0lbfLcMFuMyfBqCmsKjgo7ws-NqbMmL9I4_Q,14489
|
|
7
|
+
absfuyu/cli/__init__.py,sha256=QQv0pYorucbEoeTydtHVPwMdpiiMK_eWTxinZgQviS8,1181
|
|
8
|
+
absfuyu/cli/color.py,sha256=S_y20gw4FEVtc_cCdRjxGW8HALi2vvRT8YurmwjMH54,774
|
|
9
|
+
absfuyu/cli/config_group.py,sha256=fvWkm70LnIiL6yc9Fn7Dlg32xsjiADyLAnS3_dx1VOE,1230
|
|
10
|
+
absfuyu/cli/do_group.py,sha256=8ZwtNEZ7nadPIr-KH-Dwj1y4trZsKOgUwiof52zbUYM,2131
|
|
11
|
+
absfuyu/cli/game_group.py,sha256=21U-8QCIZtdWf6fYBPip-sT0YvP4yoB9FmogW6NSCwA,2348
|
|
12
|
+
absfuyu/cli/tool_group.py,sha256=Sx3HJHJTtsEaagsCxykrkwgp3ft9aH6BRAqs1V4mI0Q,3164
|
|
13
|
+
absfuyu/config/__init__.py,sha256=4SrWqzP_PyIjMH9QT4JjSzJqtsOWmUFlEJeoCjGd_3g,8238
|
|
14
|
+
absfuyu/config/config.json,sha256=-ZQnmDuLq0aAFfsrQbSNR3tq5k9Eu9IVUQgYD9htIQM,646
|
|
15
|
+
absfuyu/core/__init__.py,sha256=vs2FCaiXoiG0v7nRMKMickfHbeC_quTtj6JiZpI7-iU,1186
|
|
16
|
+
absfuyu/core/baseclass.py,sha256=hNmqP8YIBuNUXGduNck31rXXuZ4smTUPbMKBV-Gj41Q,10204
|
|
17
|
+
absfuyu/core/baseclass2.py,sha256=4MZTUz8WSzJn-uGY5-lSHTzkDCsRDgLnntvMwQaF8_s,5366
|
|
18
|
+
absfuyu/core/decorator.py,sha256=MpmgAb1gsXgRDEyMJLvSxUWEG0WC4aTFYJAEwjdauAI,1901
|
|
19
|
+
absfuyu/core/docstring.py,sha256=1QaqnbQLVB9qjPz2a_oCFG04XxXmOM8yWUdEVmYzYCc,5287
|
|
20
|
+
absfuyu/core/dummy_cli.py,sha256=_-Gsmg2beO7fTSP-3nSGwqVmiVKpzTICIuHfGetQbw8,1884
|
|
21
|
+
absfuyu/core/dummy_func.py,sha256=msbauMSxlbbzLzgdJqeydhAF-R4WZiA5_h6h2_8809U,1221
|
|
22
|
+
absfuyu/dxt/__init__.py,sha256=XvvcsN9Ax9ywFEuvlq4JEY4Mto3_qhp56JgWwCiWUPY,986
|
|
23
|
+
absfuyu/dxt/dictext.py,sha256=aiCvNhdDQvuYteVKptLkpC0ni9rIbN26cYEPKpIbqps,5998
|
|
24
|
+
absfuyu/dxt/dxt_support.py,sha256=7xo2-gQWfgsqvLdh7pcyK1rx4XU1-G7nWx0VbKQ69tQ,2109
|
|
25
|
+
absfuyu/dxt/intext.py,sha256=h9p8OEzb0--8u7wq50BfGG1ExY7egV_Yh8CgP2hKsdw,16716
|
|
26
|
+
absfuyu/dxt/listext.py,sha256=_sCdbnKsEAR-V60wIZxyCtXIRA7HzTu6WvIgSb_TDjQ,13964
|
|
27
|
+
absfuyu/dxt/strext.py,sha256=5YWpDz-6lZH500KcQXyQRZ_7bsRWBROfTZi0Mkr5b00,14626
|
|
28
|
+
absfuyu/extra/__init__.py,sha256=fd7WZQYt_aRsTxih5n_DvXY-5PIGCawzia4uQ5Y3huc,182
|
|
29
|
+
absfuyu/extra/beautiful.py,sha256=Ae0zhieHIbMMIJUsxDmMEEw1X14CcoyAgr-Ic2YYR9I,8137
|
|
30
|
+
absfuyu/extra/data_analysis.py,sha256=fqJgmHv9KRP2SHFTUWGMPCB8zMgfXni1jMWwn1mPYRU,32005
|
|
31
|
+
absfuyu/fun/__init__.py,sha256=20kZpFoivJXhV9oHUHOuiPCbcGvQWFE9v62EUkj4cyU,5435
|
|
32
|
+
absfuyu/fun/tarot.py,sha256=xIJNKAxgDckE4UNn8lBaLMasOT1md04BaDI_h23AmsA,2401
|
|
33
|
+
absfuyu/game/__init__.py,sha256=iKrXSOFCFFCwQVHNIRJp1ItNqSOGRQHb-31_MamVE3U,4691
|
|
34
|
+
absfuyu/game/game_stat.py,sha256=OMMz4iyyMxvEHbhVEka2uEDtREyidcOO-HX5XZi5G88,1236
|
|
35
|
+
absfuyu/game/sudoku.py,sha256=yJt950Lwcbq-sxXw-lyi1bB1Ds0y9vqYfKNRzfXwRLY,10405
|
|
36
|
+
absfuyu/game/tictactoe.py,sha256=2VV0wM3pi1weVjTR0Yp0hiWqN09yPcHeUXoqa9YVI4U,9960
|
|
37
|
+
absfuyu/game/wordle.py,sha256=cD0AOhXp5uOnyEh6vtTODmJyXcjSmQz27Di3y6xB9JM,101576
|
|
38
|
+
absfuyu/general/__init__.py,sha256=OamzZUsVcaPcwA5wA5PYPv5xl-GHmAO9cL-vzX4TJy0,472
|
|
39
|
+
absfuyu/general/content.py,sha256=5wWYto6Na8SMyA6Lh5_C_cgKNok_JCDhQCQhsImNCBQ,17122
|
|
40
|
+
absfuyu/general/human.py,sha256=o1TswjgN8zRfCmkEgchS1HVq036twBB64u1Dt4KLI1I,8099
|
|
41
|
+
absfuyu/general/shape.py,sha256=GclEwdKtciPaGsZIDpmIDvC7UiHcRKRaxIi7yqBTnfs,38619
|
|
42
|
+
absfuyu/pkg_data/__init__.py,sha256=gWOdNVaisaMfn2XBYAammTytGwZK_iTKMgyirhNCN3I,5510
|
|
43
|
+
absfuyu/pkg_data/chemistry.pkl,sha256=kYWNa_PVffoDnzT8b9Jvimmf_GZshPe1D-SnEKERsLo,4655
|
|
44
|
+
absfuyu/pkg_data/deprecated.py,sha256=NG8aqVPrC08xPBZb1n1FwNTGi2ah03zzcrp8zieaf1k,4349
|
|
45
|
+
absfuyu/pkg_data/passwordlib_lzma.pkl,sha256=rT5lJT8t42BATU5Cp2qFwbnZkbx-QlUgodSvR0wFY6I,891877
|
|
46
|
+
absfuyu/pkg_data/tarot.pkl,sha256=ssXTCC_BQgslO5F-3a9HivbxFQ6BioIe2E1frPVi2m0,56195
|
|
47
|
+
absfuyu/tools/__init__.py,sha256=u5IvTdxpr1uEE9nPXmMaDzFHGZRja_CTwKYs505N8C8,118
|
|
48
|
+
absfuyu/tools/checksum.py,sha256=cA0jL7IX7CLMuunZfiaTVZNnfg0CEy8LXaxX_UnlNuo,5156
|
|
49
|
+
absfuyu/tools/converter.py,sha256=QxWPHSJtl-_i3q8LaKWeIcdUDkkhhO7jty1K-SgQYCY,11615
|
|
50
|
+
absfuyu/tools/generator.py,sha256=C54TJ3DZ5TXFYRI7_jLdtjTMcWxACX4Jmlo27Zh90Ew,8996
|
|
51
|
+
absfuyu/tools/keygen.py,sha256=JxhUiiaUHaGqVicXY46JjVrH3ke2QlnsRJqgIvlxUsg,7115
|
|
52
|
+
absfuyu/tools/obfuscator.py,sha256=c1tBG3nbGFi7ejjRbxgBMSYV8sBQCy9Ko6r9iBO3UwY,12685
|
|
53
|
+
absfuyu/tools/passwordlib.py,sha256=s_Z9EoHCnEpHwvei5Yigo9VKkDL3sNPUkDeg8cjfSWk,9630
|
|
54
|
+
absfuyu/tools/shutdownizer.py,sha256=z5z5ofdAtOBat1m7lz95FwXZI0fMarl2mChBMwUMi4I,8549
|
|
55
|
+
absfuyu/tools/web.py,sha256=JHeW9koW_5uRwE507_mtNJ8v0R7W2yvjDxJSClkWzLM,1240
|
|
56
|
+
absfuyu/util/__init__.py,sha256=h23kB8cx4-KLMiRPFnHlxTYVqt4ortI8wCc9vUc5UVg,3831
|
|
57
|
+
absfuyu/util/api.py,sha256=gd3QCuxRfOmiGhUpN3qqdWfD0o3VFOafbKplEwWpcz0,4288
|
|
58
|
+
absfuyu/util/json_method.py,sha256=a4xVabcw18HBLJthkmf5KNUcQya45-A8AFEpcGIDx3Q,2197
|
|
59
|
+
absfuyu/util/lunar.py,sha256=P6hF6H4BmJcY0S2Jq0_TkcaiLU5O-CnyfHYoLaWTx00,13630
|
|
60
|
+
absfuyu/util/path.py,sha256=ehKib-zSISx0XguRr-OlRnNlmR27rhVSfDGmjqh6CCg,16434
|
|
61
|
+
absfuyu/util/performance.py,sha256=kZbgC8CPEjzO8JWrTjT1NqAkQ3022M4zzp7G3caeUbk,8585
|
|
62
|
+
absfuyu/util/shorten_number.py,sha256=401H1k0wxc2W6qycH_gsEGtUmYdJt6KRzMNR4m94W38,7788
|
|
63
|
+
absfuyu/util/zipped.py,sha256=nJzKxLwle9wSiKL-615J40ARiK2y0mGCwNYJ0fOCHus,2979
|
|
64
|
+
absfuyu-5.0.1.dist-info/METADATA,sha256=ypxRsGR4WuBk9BMllZqqanH766SY5mUswgvVnHVUcpI,4844
|
|
65
|
+
absfuyu-5.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
66
|
+
absfuyu-5.0.1.dist-info/entry_points.txt,sha256=bW5CgJRTTWJ2Pywojo07sf-YucRPcnHzMmETh5avbX0,79
|
|
67
|
+
absfuyu-5.0.1.dist-info/licenses/LICENSE,sha256=pFCHBSNSzdXwYG1AHpq7VcofI1NMQ1Fc77RzZ4Ln2O4,1097
|
|
68
|
+
absfuyu-5.0.1.dist-info/RECORD,,
|
absfuyu/core.py
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Absfuyu: Core
|
|
3
|
-
-------------
|
|
4
|
-
Contain type hints and other stuffs
|
|
5
|
-
|
|
6
|
-
Version: 2.3.2
|
|
7
|
-
Date updated: 11/02/2025 (dd/mm/yyyy)
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
# Module Package
|
|
11
|
-
###########################################################################
|
|
12
|
-
__all__ = [
|
|
13
|
-
# color
|
|
14
|
-
"CLITextColor",
|
|
15
|
-
# path
|
|
16
|
-
"CORE_PATH",
|
|
17
|
-
"CONFIG_PATH",
|
|
18
|
-
"DATA_PATH",
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
__package_feature__ = ["beautiful", "extra", "full", "dev"]
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
# Library
|
|
25
|
-
###########################################################################
|
|
26
|
-
from importlib import import_module
|
|
27
|
-
from importlib.resources import files
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class CLITextColor:
|
|
31
|
-
"""Color code for text in terminal"""
|
|
32
|
-
|
|
33
|
-
WHITE = "\x1b[37m"
|
|
34
|
-
BLACK = "\x1b[30m"
|
|
35
|
-
BLUE = "\x1b[34m"
|
|
36
|
-
GRAY = "\x1b[90m"
|
|
37
|
-
GREEN = "\x1b[32m"
|
|
38
|
-
RED = "\x1b[91m"
|
|
39
|
-
DARK_RED = "\x1b[31m"
|
|
40
|
-
MAGENTA = "\x1b[35m"
|
|
41
|
-
YELLOW = "\x1b[33m"
|
|
42
|
-
RESET = "\x1b[39m"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
# CORE_PATH = Path(__file__).parent.absolute()
|
|
46
|
-
CORE_PATH = files("absfuyu")
|
|
47
|
-
CONFIG_PATH = CORE_PATH.joinpath("config", "config.json")
|
|
48
|
-
DATA_PATH = CORE_PATH.joinpath("pkg_data")
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
# tqdm wrapper
|
|
52
|
-
try:
|
|
53
|
-
tqdm = import_module("tqdm").tqdm
|
|
54
|
-
except ModuleNotFoundError:
|
|
55
|
-
|
|
56
|
-
def tqdm(iterable, **kwargs):
|
|
57
|
-
return iterable
|
absfuyu/everything.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# flake8: noqa
|
|
2
|
-
"""
|
|
3
|
-
Absfuyu: Everything
|
|
4
|
-
-------------------
|
|
5
|
-
Everything has to offer in this package
|
|
6
|
-
|
|
7
|
-
Version: 2.0.1
|
|
8
|
-
Date updated: 26/11/2023 (mm/dd/yyyy)
|
|
9
|
-
|
|
10
|
-
Usage:
|
|
11
|
-
------
|
|
12
|
-
>>> from absfuyu import everything as ab
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
# Library
|
|
16
|
-
###########################################################################
|
|
17
|
-
from absfuyu.config import *
|
|
18
|
-
from absfuyu.core import *
|
|
19
|
-
from absfuyu.extensions import *
|
|
20
|
-
from absfuyu.fun import *
|
|
21
|
-
from absfuyu.game import *
|
|
22
|
-
from absfuyu.general import *
|
|
23
|
-
from absfuyu.logger import *
|
|
24
|
-
from absfuyu.pkg_data import *
|
|
25
|
-
from absfuyu.sort import *
|
|
26
|
-
from absfuyu.tools import *
|
|
27
|
-
from absfuyu.util import *
|
|
28
|
-
from absfuyu.version import *
|
|
29
|
-
|
|
30
|
-
# Is loaded
|
|
31
|
-
###########################################################################
|
|
32
|
-
__IS_EVERYTHING = True
|
absfuyu/extensions/__init__.py
DELETED
absfuyu/extensions/beautiful.py
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
# type: ignore
|
|
2
|
-
"""
|
|
3
|
-
Absfuyu: Beautiful
|
|
4
|
-
------------------
|
|
5
|
-
A decorator that makes output more beautiful
|
|
6
|
-
|
|
7
|
-
Version: 1.0.2
|
|
8
|
-
Date updated: 24/11/2023 (dd/mm/yyyy)
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
# Module level
|
|
12
|
-
###########################################################################
|
|
13
|
-
__all__ = [
|
|
14
|
-
"beautiful_output",
|
|
15
|
-
"print",
|
|
16
|
-
"demo",
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# Library
|
|
21
|
-
###########################################################################
|
|
22
|
-
from functools import wraps as __wraps
|
|
23
|
-
from time import perf_counter as __perf
|
|
24
|
-
from typing import Optional as __Optional
|
|
25
|
-
|
|
26
|
-
BEAUTIFUL_MODE = False
|
|
27
|
-
try:
|
|
28
|
-
# from rich import print
|
|
29
|
-
from rich.align import Align as __Align
|
|
30
|
-
from rich.console import Console as __Console
|
|
31
|
-
from rich.console import Group as __Group
|
|
32
|
-
from rich.panel import Panel as __Panel
|
|
33
|
-
from rich.table import Table as __Table
|
|
34
|
-
from rich.text import Text as __Text
|
|
35
|
-
except ImportError:
|
|
36
|
-
from absfuyu.config import ABSFUYU_CONFIG
|
|
37
|
-
|
|
38
|
-
if ABSFUYU_CONFIG._get_setting("auto-install-extra").value:
|
|
39
|
-
__cmd: str = "python -m pip install -U absfuyu[beautiful]".split()
|
|
40
|
-
from subprocess import run as __run
|
|
41
|
-
|
|
42
|
-
__run(__cmd)
|
|
43
|
-
else:
|
|
44
|
-
raise SystemExit("This feature is in absfuyu[beautiful] package") # noqa: B904
|
|
45
|
-
else:
|
|
46
|
-
BEAUTIFUL_MODE = True
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# Function
|
|
50
|
-
###########################################################################
|
|
51
|
-
def beautiful_output(
|
|
52
|
-
layout_option: int = 2,
|
|
53
|
-
header_visible: __Optional[bool] = True,
|
|
54
|
-
footer_visible: __Optional[bool] = False,
|
|
55
|
-
):
|
|
56
|
-
"""
|
|
57
|
-
Beautify function output
|
|
58
|
-
|
|
59
|
-
Parameters
|
|
60
|
-
----------
|
|
61
|
-
header_visible : True | False | None
|
|
62
|
-
Show header
|
|
63
|
-
|
|
64
|
-
footer_visible : True | False | None
|
|
65
|
-
Show footer
|
|
66
|
-
"""
|
|
67
|
-
|
|
68
|
-
if not BEAUTIFUL_MODE:
|
|
69
|
-
raise SystemExit("This feature is in absfuyu[beautiful] package")
|
|
70
|
-
|
|
71
|
-
def decorator(func):
|
|
72
|
-
@__wraps(func)
|
|
73
|
-
def wrapper(*args, **kwargs):
|
|
74
|
-
# Measure performance
|
|
75
|
-
start_time = __perf()
|
|
76
|
-
f = func(*args, **kwargs)
|
|
77
|
-
finished_time = __perf()
|
|
78
|
-
elapsed = f"Time elapsed: {finished_time - start_time:,.6f} s"
|
|
79
|
-
|
|
80
|
-
# Make header
|
|
81
|
-
header_table = __Table.grid(expand=True)
|
|
82
|
-
header_table.add_row(
|
|
83
|
-
__Panel(
|
|
84
|
-
__Align(f"[b]Function: {func.__name__}", align="center"),
|
|
85
|
-
style="white on blue",
|
|
86
|
-
),
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
# Make footer
|
|
90
|
-
footer_table = __Table.grid(expand=True)
|
|
91
|
-
footer_table.add_row(
|
|
92
|
-
__Panel(
|
|
93
|
-
__Align("[b]END PROGRAM", align="center"),
|
|
94
|
-
style="white on blue",
|
|
95
|
-
),
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
# Make output table
|
|
99
|
-
out_table = __Table.grid(expand=True)
|
|
100
|
-
out_table.add_column(ratio=2) # result
|
|
101
|
-
out_table.add_column() # performance
|
|
102
|
-
r_txt = __Text(
|
|
103
|
-
str(f),
|
|
104
|
-
overflow="fold",
|
|
105
|
-
no_wrap=False,
|
|
106
|
-
tab_size=2,
|
|
107
|
-
)
|
|
108
|
-
result_panel = __Panel(
|
|
109
|
-
__Align(r_txt, align="center"),
|
|
110
|
-
title="[bold]Result[/]",
|
|
111
|
-
border_style="green",
|
|
112
|
-
highlight=True,
|
|
113
|
-
)
|
|
114
|
-
performance_panel = __Panel(
|
|
115
|
-
__Align(elapsed, align="center"),
|
|
116
|
-
title="[bold]Performance[/]",
|
|
117
|
-
border_style="red",
|
|
118
|
-
highlight=True,
|
|
119
|
-
height=result_panel.height,
|
|
120
|
-
)
|
|
121
|
-
out_table.add_row(
|
|
122
|
-
result_panel,
|
|
123
|
-
performance_panel,
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
# Make a blue line for no reason
|
|
127
|
-
line = __Table.grid(expand=True)
|
|
128
|
-
line.add_row(__Text(style="white on blue"))
|
|
129
|
-
|
|
130
|
-
# Make layout
|
|
131
|
-
header = {
|
|
132
|
-
True: header_table,
|
|
133
|
-
False: line,
|
|
134
|
-
None: __Text(),
|
|
135
|
-
} # header[header_visible]
|
|
136
|
-
footer = {
|
|
137
|
-
True: footer_table,
|
|
138
|
-
False: line,
|
|
139
|
-
None: __Text(),
|
|
140
|
-
} # footer[footer_visible]
|
|
141
|
-
layout = {
|
|
142
|
-
1: __Group(header[header_visible], out_table, footer[footer_visible]),
|
|
143
|
-
2: __Group(
|
|
144
|
-
header[header_visible],
|
|
145
|
-
result_panel,
|
|
146
|
-
performance_panel,
|
|
147
|
-
footer[footer_visible],
|
|
148
|
-
),
|
|
149
|
-
3: __Group(result_panel),
|
|
150
|
-
}
|
|
151
|
-
if layout_option in layout:
|
|
152
|
-
return layout[layout_option]
|
|
153
|
-
else:
|
|
154
|
-
return layout[2]
|
|
155
|
-
# return layout[3]
|
|
156
|
-
|
|
157
|
-
return wrapper
|
|
158
|
-
|
|
159
|
-
return decorator
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
# rich's console.print wrapper
|
|
163
|
-
if BEAUTIFUL_MODE:
|
|
164
|
-
print = __Console().print
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
# demo
|
|
168
|
-
@beautiful_output()
|
|
169
|
-
def __demo_decorator(x: any = None):
|
|
170
|
-
code = """\
|
|
171
|
-
# demo
|
|
172
|
-
from absfuyu.extensions import beautiful as bu
|
|
173
|
-
@bu.beautiful_output()
|
|
174
|
-
def testcode():
|
|
175
|
-
test = [x for x in range(100)]
|
|
176
|
-
return test
|
|
177
|
-
bu.print(testcode())"""
|
|
178
|
-
if x is None:
|
|
179
|
-
x = code
|
|
180
|
-
return x
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
def demo(x: any = None):
|
|
184
|
-
print(__demo_decorator(x))
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if __name__ == "__main__":
|
|
188
|
-
demo()
|