xulbux 1.7.2__tar.gz → 1.8.0__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.
Potentially problematic release.
This version of xulbux might be problematic. Click here for more details.
- xulbux-1.8.0/PKG-INFO +190 -0
- xulbux-1.8.0/README.md +154 -0
- {xulbux-1.7.2 → xulbux-1.8.0}/pyproject.toml +21 -21
- xulbux-1.8.0/src/xulbux/__init__.py +23 -0
- xulbux-1.7.2/src/xulbux/xx_code.py → xulbux-1.8.0/src/xulbux/code.py +3 -3
- xulbux-1.7.2/src/xulbux/xx_color.py → xulbux-1.8.0/src/xulbux/color.py +1 -1
- xulbux-1.7.2/src/xulbux/xx_console.py → xulbux-1.8.0/src/xulbux/console.py +352 -200
- xulbux-1.7.2/src/xulbux/xx_data.py → xulbux-1.8.0/src/xulbux/data.py +14 -14
- xulbux-1.7.2/src/xulbux/xx_env_path.py → xulbux-1.8.0/src/xulbux/env_path.py +1 -1
- xulbux-1.7.2/src/xulbux/xx_file.py → xulbux-1.8.0/src/xulbux/file.py +1 -1
- xulbux-1.7.2/src/xulbux/xx_format_codes.py → xulbux-1.8.0/src/xulbux/format_codes.py +24 -22
- xulbux-1.7.2/src/xulbux/xx_json.py → xulbux-1.8.0/src/xulbux/json.py +3 -3
- xulbux-1.7.2/src/xulbux/xx_system.py → xulbux-1.8.0/src/xulbux/system.py +11 -11
- xulbux-1.8.0/src/xulbux.egg-info/PKG-INFO +190 -0
- {xulbux-1.7.2 → xulbux-1.8.0}/src/xulbux.egg-info/SOURCES.txt +12 -14
- xulbux-1.8.0/src/xulbux.egg-info/entry_points.txt +2 -0
- {xulbux-1.7.2 → xulbux-1.8.0}/src/xulbux.egg-info/requires.txt +3 -4
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_code.py +1 -1
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_color.py +3 -3
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_color_types.py +1 -1
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_console.py +32 -18
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_data.py +1 -1
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_env_path.py +1 -1
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_file.py +1 -2
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_format_codes.py +18 -18
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_json.py +2 -2
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_path.py +1 -2
- {xulbux-1.7.2 → xulbux-1.8.0}/tests/test_string.py +1 -1
- xulbux-1.7.2/PKG-INFO +0 -170
- xulbux-1.7.2/README.md +0 -134
- xulbux-1.7.2/src/xulbux/__init__.py +0 -25
- xulbux-1.7.2/src/xulbux/_cli_.py +0 -46
- xulbux-1.7.2/src/xulbux/_consts_.py +0 -180
- xulbux-1.7.2/src/xulbux.egg-info/PKG-INFO +0 -170
- xulbux-1.7.2/src/xulbux.egg-info/entry_points.txt +0 -3
- {xulbux-1.7.2 → xulbux-1.8.0}/LICENSE +0 -0
- {xulbux-1.7.2 → xulbux-1.8.0}/setup.cfg +0 -0
- /xulbux-1.7.2/src/xulbux/xx_path.py → /xulbux-1.8.0/src/xulbux/path.py +0 -0
- /xulbux-1.7.2/src/xulbux/xx_regex.py → /xulbux-1.8.0/src/xulbux/regex.py +0 -0
- /xulbux-1.7.2/src/xulbux/xx_string.py → /xulbux-1.8.0/src/xulbux/string.py +0 -0
- {xulbux-1.7.2 → xulbux-1.8.0}/src/xulbux.egg-info/dependency_links.txt +0 -0
- {xulbux-1.7.2 → xulbux-1.8.0}/src/xulbux.egg-info/top_level.txt +0 -0
xulbux-1.8.0/PKG-INFO
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xulbux
|
|
3
|
+
Version: 1.8.0
|
|
4
|
+
Summary: A Python library which includes lots of helpful classes, types and functions aiming to make common programming tasks simpler.
|
|
5
|
+
Author-email: XulbuX <xulbux.real@gmail.com>
|
|
6
|
+
Maintainer-email: XulbuX <xulbux.real@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/XulbuX/PythonLibraryXulbuX
|
|
9
|
+
Project-URL: Documentation, https://github.com/XulbuX/PythonLibraryXulbuX/wiki
|
|
10
|
+
Project-URL: Source Code, https://github.com/XulbuX/PythonLibraryXulbuX/tree/main/src
|
|
11
|
+
Project-URL: Changelog, https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/CHANGELOG.md
|
|
12
|
+
Project-URL: Bug Reports, https://github.com/XulbuX/PythonLibraryXulbuX/issues
|
|
13
|
+
Project-URL: Stats, https://clickpy.clickhouse.com/dashboard/xulbux
|
|
14
|
+
Project-URL: License, https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/LICENSE
|
|
15
|
+
Keywords: args,arguments,attributes,classes,client,cmd,code,codes,color,commands,console,constants,consts,conversion,convert,data,debug,easier,env,environment,error,file,format,formatting,functions,helper,hex,hexa,hsl,hsla,info,input,json,library,log,logging,methods,nice,operations,path,presets,pretty,printing,properties,python,re,regex,rgb,rgba,string,structures,system,tools,types,utility,warn,warning,xulbux
|
|
16
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Classifier: Intended Audience :: Developers
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Requires-Python: >=3.10.0
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
Requires-Dist: keyboard>=0.13.5
|
|
27
|
+
Requires-Dist: prompt_toolkit>=3.0.41
|
|
28
|
+
Requires-Dist: pyperclip>=1.9.0
|
|
29
|
+
Requires-Dist: regex>=2023.10.3
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: black>=23.7.0; extra == "dev"
|
|
32
|
+
Requires-Dist: flake8-pyproject>=1.2.3; extra == "dev"
|
|
33
|
+
Requires-Dist: flake8>=6.1.0; extra == "dev"
|
|
34
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest>=7.4.2; extra == "dev"
|
|
36
|
+
|
|
37
|
+
# **XulbuX**
|
|
38
|
+
|
|
39
|
+
[](https://pypi.org/project/xulbux) [](https://clickpy.clickhouse.com/dashboard/xulbux) [](https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/LICENSE) [](https://github.com/XulbuX/PythonLibraryXulbuX/commits) [](https://github.com/XulbuX/PythonLibraryXulbuX/issues)
|
|
40
|
+
|
|
41
|
+
**XulbuX** is a library that contains many useful classes, types, and functions,
|
|
42
|
+
ranging from console logging and working with colors to file management and system operations.
|
|
43
|
+
The library is designed to simplify common programming tasks and improve code readability through its collection of tools.
|
|
44
|
+
|
|
45
|
+
For precise information about the library, see the library's [**documentation**](https://github.com/XulbuX/PythonLibraryXulbuX/wiki).<br>
|
|
46
|
+
For the libraries latest changes and updates, see the [**change log**](https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/CHANGELOG.md).
|
|
47
|
+
|
|
48
|
+
### The best modules, you have to check out:
|
|
49
|
+
|
|
50
|
+
[](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/format_codes) [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/console) [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/color)
|
|
51
|
+
|
|
52
|
+
<br>
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
Run the following commands in a console with administrator privileges, so the actions take effect for all users.
|
|
57
|
+
|
|
58
|
+
Install the library and all its dependencies with the command:
|
|
59
|
+
```console
|
|
60
|
+
pip install xulbux
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Upgrade the library and all its dependencies to their latest available version with the command:
|
|
64
|
+
```console
|
|
65
|
+
pip install --upgrade xulbux
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
<br>
|
|
69
|
+
|
|
70
|
+
## CLI Commands
|
|
71
|
+
|
|
72
|
+
When the library is installed, the following commands are available in the console:
|
|
73
|
+
| Command | Description |
|
|
74
|
+
| :------------ | :--------------------------------------- |
|
|
75
|
+
| `xulbux-help` | shows some information about the library |
|
|
76
|
+
|
|
77
|
+
<br>
|
|
78
|
+
|
|
79
|
+
## Usage
|
|
80
|
+
|
|
81
|
+
Import the full library under the alias `xx`, so its constants, classes, methods, and types are accessible with `xx.CONSTANT.value`, `xx.Class.method()`, `xx.type()`:
|
|
82
|
+
```python
|
|
83
|
+
import xulbux as xx
|
|
84
|
+
```
|
|
85
|
+
So you don't have to import the full library under an alias, you can also import only certain parts of the library's contents:
|
|
86
|
+
```python
|
|
87
|
+
# LIBRARY CONSTANTS
|
|
88
|
+
from xulbux.base.consts import COLOR, CHARS, ANSI
|
|
89
|
+
# Main Classes
|
|
90
|
+
from xulbux import Code, Color, Console, ...
|
|
91
|
+
# module specific imports
|
|
92
|
+
from xulbux.color import rgba, hsla, hexa
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
<br>
|
|
96
|
+
|
|
97
|
+
## Modules
|
|
98
|
+
|
|
99
|
+
| Module | Short Description |
|
|
100
|
+
| :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ |
|
|
101
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/base) | includes more modules like library constants |
|
|
102
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/code) | advanced code-string operations (*changing the indent, finding function calls, ...*) |
|
|
103
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/color) | everything around colors (*converting, blending, searching colors in strings, ...*) |
|
|
104
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/console) | advanced actions related to the console (*pretty logging, advanced inputs, ...*) |
|
|
105
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/data) | advanced operations with data structures (*compare, generate path IDs, pretty print, ...*) |
|
|
106
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/env_path) | getting and editing the PATH variable (*get paths, check for paths, add paths, ...*) |
|
|
107
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/file) | advanced working with files (*create files, rename file-extensions, ...*) |
|
|
108
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/format_codes) | easy pretty printing using custom format codes (*print, inputs, format codes to ANSI, ...*) |
|
|
109
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/json) | advanced working with json files (*read, create, update, ...*) |
|
|
110
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/path) | advanced path operations (*get paths, smart-extend relative paths, delete paths, ...*) |
|
|
111
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/regex) | generated regex pattern-templates (*match bracket- and quote pairs, match colors, ...*) |
|
|
112
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/string) | helpful actions when working with strings. (*normalize, escape, decompose, ...*) |
|
|
113
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/system) | advanced system actions (*restart with message, check installed Python libs, ...*) |
|
|
114
|
+
|
|
115
|
+
<br>
|
|
116
|
+
|
|
117
|
+
## Example Usage
|
|
118
|
+
|
|
119
|
+
This is what it could look like using this library for a simple but ultra good-looking color converter:
|
|
120
|
+
```python
|
|
121
|
+
from xulbux.base.consts import COLOR, CHARS
|
|
122
|
+
from xulbux.color import hexa
|
|
123
|
+
from xulbux import Console
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def main() -> None:
|
|
127
|
+
|
|
128
|
+
# LET THE USER ENTER A HEXA COLOR IN ANY HEXA FORMAT
|
|
129
|
+
input_clr = Console.input(
|
|
130
|
+
"[b](Enter a HEXA color in any format) > ",
|
|
131
|
+
start="\n",
|
|
132
|
+
placeholder="#7075FF",
|
|
133
|
+
max_len=7,
|
|
134
|
+
allowed_chars=CHARS.HEX_DIGITS,
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
# ANNOUNCE INDEXING THE INPUT COLOR
|
|
138
|
+
Console.log(
|
|
139
|
+
"INDEX",
|
|
140
|
+
"Indexing the input HEXA color...",
|
|
141
|
+
start="\n",
|
|
142
|
+
title_bg_color=COLOR.BLUE,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
try:
|
|
146
|
+
# TRY TO CONVERT THE INPUT COLOR INTO A hexa() COLOR
|
|
147
|
+
hexa_color = hexa(input_clr)
|
|
148
|
+
|
|
149
|
+
except ValueError:
|
|
150
|
+
# ANNOUNCE THE ERROR AND EXIT THE PROGRAM
|
|
151
|
+
Console.fail(
|
|
152
|
+
"The input HEXA color is invalid.",
|
|
153
|
+
end="\n\n",
|
|
154
|
+
exit=True,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
# ANNOUNCE STARTING THE CONVERSION
|
|
158
|
+
Console.log(
|
|
159
|
+
"CONVERT",
|
|
160
|
+
"Converting the HEXA color into different types...",
|
|
161
|
+
title_bg_color=COLOR.TANGERINE,
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
# CONVERT THE HEXA COLOR INTO THE TWO OTHER COLOR TYPES
|
|
165
|
+
rgba_color = hexa_color.to_rgba()
|
|
166
|
+
hsla_color = hexa_color.to_hsla()
|
|
167
|
+
|
|
168
|
+
# ANNOUNCE THE SUCCESSFUL CONVERSION
|
|
169
|
+
Console.done(
|
|
170
|
+
"Successfully converted color into different types.",
|
|
171
|
+
end="\n\n",
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
# PRETTY PRINT THE COLOR IN DIFFERENT TYPES
|
|
175
|
+
Console.log_box_bordered(
|
|
176
|
+
f"[b](HEXA:) [i|white]({hexa_color})",
|
|
177
|
+
f"[b](RGBA:) [i|white]({rgba_color})",
|
|
178
|
+
f"[b](HSLA:) [i|white]({hsla_color})",
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
if __name__ == "__main__":
|
|
183
|
+
main()
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
<br>
|
|
187
|
+
<br>
|
|
188
|
+
|
|
189
|
+
--------------------------------------------------------------
|
|
190
|
+
[View this library on **PyPI**](https://pypi.org/project/xulbux)
|
xulbux-1.8.0/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# **XulbuX**
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/xulbux) [](https://clickpy.clickhouse.com/dashboard/xulbux) [](https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/LICENSE) [](https://github.com/XulbuX/PythonLibraryXulbuX/commits) [](https://github.com/XulbuX/PythonLibraryXulbuX/issues)
|
|
4
|
+
|
|
5
|
+
**XulbuX** is a library that contains many useful classes, types, and functions,
|
|
6
|
+
ranging from console logging and working with colors to file management and system operations.
|
|
7
|
+
The library is designed to simplify common programming tasks and improve code readability through its collection of tools.
|
|
8
|
+
|
|
9
|
+
For precise information about the library, see the library's [**documentation**](https://github.com/XulbuX/PythonLibraryXulbuX/wiki).<br>
|
|
10
|
+
For the libraries latest changes and updates, see the [**change log**](https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/CHANGELOG.md).
|
|
11
|
+
|
|
12
|
+
### The best modules, you have to check out:
|
|
13
|
+
|
|
14
|
+
[](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/format_codes) [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/console) [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/color)
|
|
15
|
+
|
|
16
|
+
<br>
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
Run the following commands in a console with administrator privileges, so the actions take effect for all users.
|
|
21
|
+
|
|
22
|
+
Install the library and all its dependencies with the command:
|
|
23
|
+
```console
|
|
24
|
+
pip install xulbux
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Upgrade the library and all its dependencies to their latest available version with the command:
|
|
28
|
+
```console
|
|
29
|
+
pip install --upgrade xulbux
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
<br>
|
|
33
|
+
|
|
34
|
+
## CLI Commands
|
|
35
|
+
|
|
36
|
+
When the library is installed, the following commands are available in the console:
|
|
37
|
+
| Command | Description |
|
|
38
|
+
| :------------ | :--------------------------------------- |
|
|
39
|
+
| `xulbux-help` | shows some information about the library |
|
|
40
|
+
|
|
41
|
+
<br>
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
Import the full library under the alias `xx`, so its constants, classes, methods, and types are accessible with `xx.CONSTANT.value`, `xx.Class.method()`, `xx.type()`:
|
|
46
|
+
```python
|
|
47
|
+
import xulbux as xx
|
|
48
|
+
```
|
|
49
|
+
So you don't have to import the full library under an alias, you can also import only certain parts of the library's contents:
|
|
50
|
+
```python
|
|
51
|
+
# LIBRARY CONSTANTS
|
|
52
|
+
from xulbux.base.consts import COLOR, CHARS, ANSI
|
|
53
|
+
# Main Classes
|
|
54
|
+
from xulbux import Code, Color, Console, ...
|
|
55
|
+
# module specific imports
|
|
56
|
+
from xulbux.color import rgba, hsla, hexa
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
<br>
|
|
60
|
+
|
|
61
|
+
## Modules
|
|
62
|
+
|
|
63
|
+
| Module | Short Description |
|
|
64
|
+
| :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ |
|
|
65
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/base) | includes more modules like library constants |
|
|
66
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/code) | advanced code-string operations (*changing the indent, finding function calls, ...*) |
|
|
67
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/color) | everything around colors (*converting, blending, searching colors in strings, ...*) |
|
|
68
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/console) | advanced actions related to the console (*pretty logging, advanced inputs, ...*) |
|
|
69
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/data) | advanced operations with data structures (*compare, generate path IDs, pretty print, ...*) |
|
|
70
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/env_path) | getting and editing the PATH variable (*get paths, check for paths, add paths, ...*) |
|
|
71
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/file) | advanced working with files (*create files, rename file-extensions, ...*) |
|
|
72
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/format_codes) | easy pretty printing using custom format codes (*print, inputs, format codes to ANSI, ...*) |
|
|
73
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/json) | advanced working with json files (*read, create, update, ...*) |
|
|
74
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/path) | advanced path operations (*get paths, smart-extend relative paths, delete paths, ...*) |
|
|
75
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/regex) | generated regex pattern-templates (*match bracket- and quote pairs, match colors, ...*) |
|
|
76
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/string) | helpful actions when working with strings. (*normalize, escape, decompose, ...*) |
|
|
77
|
+
| [](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/system) | advanced system actions (*restart with message, check installed Python libs, ...*) |
|
|
78
|
+
|
|
79
|
+
<br>
|
|
80
|
+
|
|
81
|
+
## Example Usage
|
|
82
|
+
|
|
83
|
+
This is what it could look like using this library for a simple but ultra good-looking color converter:
|
|
84
|
+
```python
|
|
85
|
+
from xulbux.base.consts import COLOR, CHARS
|
|
86
|
+
from xulbux.color import hexa
|
|
87
|
+
from xulbux import Console
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def main() -> None:
|
|
91
|
+
|
|
92
|
+
# LET THE USER ENTER A HEXA COLOR IN ANY HEXA FORMAT
|
|
93
|
+
input_clr = Console.input(
|
|
94
|
+
"[b](Enter a HEXA color in any format) > ",
|
|
95
|
+
start="\n",
|
|
96
|
+
placeholder="#7075FF",
|
|
97
|
+
max_len=7,
|
|
98
|
+
allowed_chars=CHARS.HEX_DIGITS,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
# ANNOUNCE INDEXING THE INPUT COLOR
|
|
102
|
+
Console.log(
|
|
103
|
+
"INDEX",
|
|
104
|
+
"Indexing the input HEXA color...",
|
|
105
|
+
start="\n",
|
|
106
|
+
title_bg_color=COLOR.BLUE,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
try:
|
|
110
|
+
# TRY TO CONVERT THE INPUT COLOR INTO A hexa() COLOR
|
|
111
|
+
hexa_color = hexa(input_clr)
|
|
112
|
+
|
|
113
|
+
except ValueError:
|
|
114
|
+
# ANNOUNCE THE ERROR AND EXIT THE PROGRAM
|
|
115
|
+
Console.fail(
|
|
116
|
+
"The input HEXA color is invalid.",
|
|
117
|
+
end="\n\n",
|
|
118
|
+
exit=True,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
# ANNOUNCE STARTING THE CONVERSION
|
|
122
|
+
Console.log(
|
|
123
|
+
"CONVERT",
|
|
124
|
+
"Converting the HEXA color into different types...",
|
|
125
|
+
title_bg_color=COLOR.TANGERINE,
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
# CONVERT THE HEXA COLOR INTO THE TWO OTHER COLOR TYPES
|
|
129
|
+
rgba_color = hexa_color.to_rgba()
|
|
130
|
+
hsla_color = hexa_color.to_hsla()
|
|
131
|
+
|
|
132
|
+
# ANNOUNCE THE SUCCESSFUL CONVERSION
|
|
133
|
+
Console.done(
|
|
134
|
+
"Successfully converted color into different types.",
|
|
135
|
+
end="\n\n",
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
# PRETTY PRINT THE COLOR IN DIFFERENT TYPES
|
|
139
|
+
Console.log_box_bordered(
|
|
140
|
+
f"[b](HEXA:) [i|white]({hexa_color})",
|
|
141
|
+
f"[b](RGBA:) [i|white]({rgba_color})",
|
|
142
|
+
f"[b](HSLA:) [i|white]({hsla_color})",
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
if __name__ == "__main__":
|
|
147
|
+
main()
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
<br>
|
|
151
|
+
<br>
|
|
152
|
+
|
|
153
|
+
--------------------------------------------------------------
|
|
154
|
+
[View this library on **PyPI**](https://pypi.org/project/xulbux)
|
|
@@ -4,34 +4,35 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "xulbux"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.8.0"
|
|
8
8
|
authors = [{ name = "XulbuX", email = "xulbux.real@gmail.com" }]
|
|
9
|
+
maintainers = [{ name = "XulbuX", email = "xulbux.real@gmail.com" }]
|
|
9
10
|
description = "A Python library which includes lots of helpful classes, types and functions aiming to make common programming tasks simpler."
|
|
10
11
|
readme = "README.md"
|
|
11
12
|
license = "MIT"
|
|
12
|
-
license-files = ["
|
|
13
|
+
license-files = ["LICEN[CS]E.*"]
|
|
13
14
|
requires-python = ">=3.10.0"
|
|
14
15
|
dependencies = [
|
|
15
16
|
"keyboard>=0.13.5",
|
|
16
|
-
"mouse>=0.7.1",
|
|
17
17
|
"prompt_toolkit>=3.0.41",
|
|
18
18
|
"pyperclip>=1.9.0",
|
|
19
19
|
"regex>=2023.10.3",
|
|
20
20
|
]
|
|
21
21
|
optional-dependencies = { dev = [
|
|
22
|
-
"pytest>=7.4.2",
|
|
23
22
|
"black>=23.7.0",
|
|
24
|
-
"isort>=5.12.0",
|
|
25
|
-
"flake8>=6.1.0",
|
|
26
23
|
"flake8-pyproject>=1.2.3",
|
|
24
|
+
"flake8>=6.1.0",
|
|
25
|
+
"isort>=5.12.0",
|
|
26
|
+
"pytest>=7.4.2",
|
|
27
27
|
] }
|
|
28
28
|
classifiers = [
|
|
29
|
-
"
|
|
30
|
-
"Programming Language :: Python :: 3",
|
|
31
|
-
"Programming Language :: Python :: 3.10",
|
|
32
|
-
"Programming Language :: Python :: 3.11",
|
|
29
|
+
"Development Status :: 5 - Production/Stable",
|
|
30
|
+
"Programming Language :: Python :: 3.13",
|
|
33
31
|
"Programming Language :: Python :: 3.12",
|
|
32
|
+
"Programming Language :: Python :: 3.11",
|
|
33
|
+
"Programming Language :: Python :: 3.10",
|
|
34
34
|
"Operating System :: OS Independent",
|
|
35
|
+
"Intended Audience :: Developers",
|
|
35
36
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
36
37
|
]
|
|
37
38
|
keywords = [
|
|
@@ -39,17 +40,17 @@ keywords = [
|
|
|
39
40
|
"arguments",
|
|
40
41
|
"attributes",
|
|
41
42
|
"classes",
|
|
42
|
-
"cmd",
|
|
43
43
|
"client",
|
|
44
|
+
"cmd",
|
|
44
45
|
"code",
|
|
45
46
|
"codes",
|
|
46
47
|
"color",
|
|
47
48
|
"commands",
|
|
48
49
|
"console",
|
|
49
|
-
"consts",
|
|
50
50
|
"constants",
|
|
51
|
-
"
|
|
51
|
+
"consts",
|
|
52
52
|
"conversion",
|
|
53
|
+
"convert",
|
|
53
54
|
"data",
|
|
54
55
|
"debug",
|
|
55
56
|
"easier",
|
|
@@ -96,17 +97,16 @@ keywords = [
|
|
|
96
97
|
]
|
|
97
98
|
|
|
98
99
|
[project.urls]
|
|
99
|
-
"Bug Reports" = "https://github.com/XulbuX/PythonLibraryXulbuX/issues"
|
|
100
|
-
"Changelog" = "https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/CHANGELOG.md"
|
|
101
|
-
"Documentation" = "https://github.com/XulbuX/PythonLibraryXulbuX/wiki"
|
|
102
100
|
"Homepage" = "https://github.com/XulbuX/PythonLibraryXulbuX"
|
|
103
|
-
"
|
|
101
|
+
"Documentation" = "https://github.com/XulbuX/PythonLibraryXulbuX/wiki"
|
|
104
102
|
"Source Code" = "https://github.com/XulbuX/PythonLibraryXulbuX/tree/main/src"
|
|
105
|
-
|
|
103
|
+
"Changelog" = "https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/CHANGELOG.md"
|
|
104
|
+
"Bug Reports" = "https://github.com/XulbuX/PythonLibraryXulbuX/issues"
|
|
105
|
+
"Stats" = "https://clickpy.clickhouse.com/dashboard/xulbux"
|
|
106
|
+
"License" = "https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/LICENSE"
|
|
106
107
|
|
|
107
108
|
[project.scripts]
|
|
108
|
-
|
|
109
|
-
xulbux-help = "xulbux._cli_:help_command"
|
|
109
|
+
xulbux-help = "xulbux.cli.help:show_help"
|
|
110
110
|
|
|
111
111
|
[tool.black]
|
|
112
112
|
line-length = 127
|
|
@@ -152,8 +152,8 @@ addopts = "-ra -q"
|
|
|
152
152
|
pythonpath = ["src"]
|
|
153
153
|
testpaths = [
|
|
154
154
|
"tests/test_code.py",
|
|
155
|
-
"tests/test_color.py",
|
|
156
155
|
"tests/test_color_types.py",
|
|
156
|
+
"tests/test_color.py",
|
|
157
157
|
"tests/test_console.py",
|
|
158
158
|
"tests/test_data.py",
|
|
159
159
|
"tests/test_env_path.py",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
__version__ = "1.8.0"
|
|
2
|
+
|
|
3
|
+
__author__ = "XulbuX"
|
|
4
|
+
__email__ = "xulbux.real@gmail.com"
|
|
5
|
+
__license__ = "MIT"
|
|
6
|
+
__copyright__ = "Copyright (c) 2024 XulbuX"
|
|
7
|
+
__url__ = "https://github.com/XulbuX/PythonLibraryXulbuX"
|
|
8
|
+
__description__ = "A Python library which includes lots of helpful classes, types, and functions aiming to make common programming tasks simpler."
|
|
9
|
+
|
|
10
|
+
__all__ = ["Code", "Color", "Console", "Data", "EnvPath", "File", "FormatCodes", "Json", "Path", "Regex", "String", "System"]
|
|
11
|
+
|
|
12
|
+
from .code import Code
|
|
13
|
+
from .color import Color
|
|
14
|
+
from .console import Console
|
|
15
|
+
from .data import Data
|
|
16
|
+
from .env_path import EnvPath
|
|
17
|
+
from .file import File
|
|
18
|
+
from .format_codes import FormatCodes
|
|
19
|
+
from .json import Json
|
|
20
|
+
from .path import Path
|
|
21
|
+
from .regex import Regex
|
|
22
|
+
from .string import String
|
|
23
|
+
from .system import System
|
|
@@ -31,7 +31,7 @@ The `Color` class, which contains all sorts of different color-related methods:
|
|
|
31
31
|
- saturation
|
|
32
32
|
"""
|
|
33
33
|
|
|
34
|
-
from .
|
|
34
|
+
from .regex import Regex
|
|
35
35
|
|
|
36
36
|
from typing import Annotated, TypeAlias, Iterator, Optional, Literal, Union, Any, cast
|
|
37
37
|
import re as _re
|