xulbux 1.5.5__tar.gz → 1.5.8__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.5.8/.github/workflows/python-package.yml +49 -0
- xulbux-1.5.8/.gitignore +31 -0
- {xulbux-1.5.5 → xulbux-1.5.8}/CHANGELOG.md +92 -61
- {xulbux-1.5.5 → xulbux-1.5.8}/PKG-INFO +23 -19
- {xulbux-1.5.5 → xulbux-1.5.8}/README.md +10 -10
- xulbux-1.5.8/documentation/Home.md +71 -0
- xulbux-1.5.8/documentation/xx_code.md +49 -0
- xulbux-1.5.8/documentation/xx_color.md +664 -0
- xulbux-1.5.8/documentation/xx_console.md +135 -0
- xulbux-1.5.8/documentation/xx_data.md +210 -0
- xulbux-1.5.8/documentation/xx_env_path.md +42 -0
- xulbux-1.5.8/documentation/xx_string.md +13 -0
- xulbux-1.5.8/pyproject.toml +123 -0
- xulbux-1.5.8/src/XulbuX/__init__.py +57 -0
- xulbux-1.5.5/src/XulbuX/__help__.py → xulbux-1.5.8/src/XulbuX/_cli_.py +23 -45
- xulbux-1.5.8/src/XulbuX/_consts_.py +144 -0
- {xulbux-1.5.5 → xulbux-1.5.8}/src/XulbuX/xx_code.py +31 -28
- {xulbux-1.5.5 → xulbux-1.5.8}/src/XulbuX/xx_color.py +364 -205
- xulbux-1.5.8/src/XulbuX/xx_console.py +381 -0
- xulbux-1.5.8/src/XulbuX/xx_data.py +528 -0
- xulbux-1.5.8/src/XulbuX/xx_env_path.py +113 -0
- {xulbux-1.5.5 → xulbux-1.5.8}/src/XulbuX/xx_file.py +22 -16
- xulbux-1.5.8/src/XulbuX/xx_format_codes.py +277 -0
- {xulbux-1.5.5 → xulbux-1.5.8}/src/XulbuX/xx_json.py +38 -18
- {xulbux-1.5.5 → xulbux-1.5.8}/src/XulbuX/xx_path.py +38 -23
- {xulbux-1.5.5 → xulbux-1.5.8}/src/XulbuX/xx_regex.py +64 -29
- xulbux-1.5.8/src/XulbuX/xx_string.py +173 -0
- {xulbux-1.5.5 → xulbux-1.5.8}/src/XulbuX/xx_system.py +37 -26
- xulbux-1.5.8/tests/test_cmd_info.py +21 -0
- xulbux-1.5.8/tests/test_color.py +18 -0
- xulbux-1.5.8/tests/test_color_types.py +100 -0
- xulbux-1.5.8/tests/test_data.py +51 -0
- xulbux-1.5.8/tests/test_env_vars.py +25 -0
- xulbux-1.5.5/.gitignore +0 -61
- xulbux-1.5.5/pyproject.toml +0 -74
- xulbux-1.5.5/src/XulbuX/__init__.py +0 -47
- xulbux-1.5.5/src/XulbuX/_consts_.py +0 -147
- xulbux-1.5.5/src/XulbuX/xx_cmd.py +0 -240
- xulbux-1.5.5/src/XulbuX/xx_data.py +0 -431
- xulbux-1.5.5/src/XulbuX/xx_env_vars.py +0 -60
- xulbux-1.5.5/src/XulbuX/xx_format_codes.py +0 -212
- xulbux-1.5.5/src/XulbuX/xx_string.py +0 -116
- xulbux-1.5.5/tests/_diverse_.py +0 -99
- xulbux-1.5.5/tests/cmd_info.py +0 -7
- xulbux-1.5.5/tests/color-types.py +0 -68
- xulbux-1.5.5/tests/luminance.py +0 -35
- {xulbux-1.5.5 → xulbux-1.5.8}/LICENSE +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# THIS WORKFLOW WILL INSTALL PYTHON DEPENDENCIES, RUN TESTS AND LINT WITH A VARIETY OF PYTHON VERSIONS
|
|
2
|
+
# FOR MORE INFORMATION SEE: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
|
3
|
+
|
|
4
|
+
name: Python package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: ["main"]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: ["main"]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
+
uses: actions/setup-python@v3
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Cache pip packages
|
|
29
|
+
uses: actions/cache@v3
|
|
30
|
+
with:
|
|
31
|
+
path: ~/.cache/pip
|
|
32
|
+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/pyproject.toml') }}
|
|
33
|
+
restore-keys: |
|
|
34
|
+
${{ runner.os }}-pip-
|
|
35
|
+
|
|
36
|
+
- name: Install project and dependencies
|
|
37
|
+
run: |
|
|
38
|
+
python -m pip install --upgrade pip
|
|
39
|
+
pip install -e .[dev] # INSTALL PROJECT AND DEV DEPENDENCIES
|
|
40
|
+
pip install flake8 pytest # ENSURE BOTH flake8 AND pytest ARE INSTALLED
|
|
41
|
+
|
|
42
|
+
- name: Lint with flake8
|
|
43
|
+
run: |
|
|
44
|
+
python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
45
|
+
python -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
46
|
+
|
|
47
|
+
- name: Test with pytest
|
|
48
|
+
run: |
|
|
49
|
+
python -m pytest --verbose # RUN pytest USING PYTHON MODULE TO AVOID PATH ISSUES
|
xulbux-1.5.8/.gitignore
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Python bytecode
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
.Python
|
|
8
|
+
wheels/
|
|
9
|
+
build/
|
|
10
|
+
dist/
|
|
11
|
+
|
|
12
|
+
# PyBuilder
|
|
13
|
+
.pybuilder/
|
|
14
|
+
target/
|
|
15
|
+
|
|
16
|
+
.python-version
|
|
17
|
+
|
|
18
|
+
# PEP 582
|
|
19
|
+
__pypackages__/
|
|
20
|
+
|
|
21
|
+
# pytype static type analyzer
|
|
22
|
+
.pytype/
|
|
23
|
+
|
|
24
|
+
# Cython debug symbols
|
|
25
|
+
cython_debug/
|
|
26
|
+
|
|
27
|
+
# VS Code
|
|
28
|
+
.vscode/
|
|
29
|
+
|
|
30
|
+
# Pytest
|
|
31
|
+
.pytest_cache/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
border-radius: 0.2em;
|
|
8
8
|
text-align: center;
|
|
9
9
|
justify-content: center;
|
|
10
|
-
">🠫</div>
|
|
10
|
+
"><span style="display:none">go to bottom </span>🠫</div>
|
|
11
11
|
</abbr></a>
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -15,68 +15,99 @@
|
|
|
15
15
|
# <br><b>Changelog</b><br>
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
## ... `v1.5.
|
|
19
|
-
*
|
|
18
|
+
## ... `v1.5.8`
|
|
19
|
+
* renamed the library from `XulbuX` to `xulbux` for better naming conventions
|
|
20
|
+
* added method `String.is_empty()` to check if the string is empty
|
|
21
|
+
* added method `String.escape()` to escape special characters in a string
|
|
22
|
+
* introduced a new test for `xx_data` (*all methods*)
|
|
23
|
+
* added doc-strings to all the methods in `xx_data`
|
|
24
|
+
* made all the methods from `xx_data` work wih all the types of data structures (*`list`, `tuple`, `set`, `frozenset`, `dict`*)
|
|
25
|
+
* renamed the module `xx_cmd` and it's class `Cmd` to `xx_console` and `Console`
|
|
26
|
+
* renamed the module `xx_env_vars` and it's class `EnvVars` to `xx_env_path` and `EnvPath`
|
|
27
|
+
* added method `EnvPath.remove_path()`
|
|
28
|
+
* introduced a new test for `xx_env_vars` (*all methods*)
|
|
29
|
+
* Added a `hexa_str()` preset to the `xx_regex` module
|
|
30
|
+
* introduced a new test for the methods from the `Color` class in `xx_color`
|
|
31
|
+
|
|
32
|
+
## 15.11.2024 `v1.5.7`
|
|
33
|
+
* change the testing modules to be able to run together with the library `pytest`
|
|
34
|
+
* added formatting checks, using `black`, `isort` and `flake8`
|
|
35
|
+
* added the script (*command*) `xx-help` or `xulbux-help`
|
|
36
|
+
* moved the `help()` function to the file `_cli_.py`, because that's where all the scripts are located (*It also was renamed to* `help_command()`)
|
|
37
|
+
* structured `Cmd.restricted_input()` a bit nicer, so it appears less complex
|
|
38
|
+
* corrected code after `Lint with flake8` formatting suggestions
|
|
39
|
+
* moved the method `normalize_spaces()` to `xx_string`
|
|
40
|
+
* added additional tests for the custom color types
|
|
41
|
+
* updated the whole `xx_format_codes` module for more efficiency and speed
|
|
42
|
+
|
|
43
|
+
## 11.11.2024 `v1.5.6`
|
|
44
|
+
* moved the whole library to it's own repository: [PythonLibraryXulbuX](https://github.com/XulbuX-dev/PythonLibraryXulbuX)
|
|
45
|
+
* updated all connections and links
|
|
46
|
+
|
|
47
|
+
## 11.11.2024 `v1.5.5`
|
|
48
|
+
* added methods to get the width and height of the console (*in characters and lines*):<br>
|
|
20
49
|
<code>Cmd.w() -> *int*</code> how many text characters the console is wide<br>
|
|
21
50
|
<code>Cmd.h() -> *int*</code> how many lines the console is high<br>
|
|
22
51
|
<code>Cmd.wh() -> *tuple[int,int]*</code> a tuple with width and height
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
52
|
+
* added the method <code>split_count(*string*, *count*) -> *list*[*str*]</code> to `xx_string`
|
|
53
|
+
* added doc-strings to every method in `xx_string`
|
|
54
|
+
* updated the `Cmd.restricted_input()` method:
|
|
26
55
|
- paste text from the clipboard
|
|
27
56
|
- select all text to delete everything at once
|
|
28
57
|
- write and backspace over multiple lines
|
|
29
|
-
|
|
30
|
-
*
|
|
58
|
+
- not the prompt supports custom format codes
|
|
59
|
+
* added required non-standard libraries to the project file
|
|
60
|
+
* added more metadata to the project file
|
|
31
61
|
|
|
32
62
|
## 06.11.2024 `v1.5.4`
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
|
|
41
|
-
|
|
63
|
+
* made the `blend()` method from all the color types modify the *`self`* object as well as returning the result
|
|
64
|
+
* added a new method <code>normalize_spaces(*code*) -> *str*</code> to `Code`
|
|
65
|
+
* added new doc-strings to `xx_code` and `xx_cmd`
|
|
66
|
+
* added a custom `input()` method to `Cmd`, which lets you specify the allowed text characters the user can type, as well as the minimum and maximum length of the input
|
|
67
|
+
* added the method `pwd_input()` to `Cmd`, which works just like the `Cmd.restricted_input()` but masks the input characters with `*`
|
|
68
|
+
* restructured the whole library's imports, so you the custom types won't get displayed as `Any` when hovering over a method/function
|
|
69
|
+
* fixed bug when trying to get the base directory from a compiled script (*EXE*):<br>
|
|
70
|
+
would get the path to the temporary extracted directory, which is created when running the EXE file<br>
|
|
71
|
+
now it gets the actual base directory of the currently running file
|
|
42
72
|
|
|
43
73
|
## 30.10.2024 `v1.5.3`
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
74
|
+
* restructured the values in `_consts_.py`
|
|
75
|
+
* added the default text color to the `_consts_.py` so it's easier to change it (*and used it in the library*)
|
|
76
|
+
* added a bunch of other default colors to the `_consts_.py` (*and used them in the library*)
|
|
77
|
+
* refactored the whole library's code after the [`PEPs`](https://peps.python.org/) and [`The Zen of Python`](https://peps.python.org/pep-0020/#the-zen-of-python) 🫡:
|
|
48
78
|
- changed the indent to 4 spaces
|
|
49
79
|
- no more inline control statements (*except its only a really small statement and body*)
|
|
50
|
-
*
|
|
80
|
+
* added new methods to `Color`:<br>
|
|
51
81
|
<code>rgba_to_hex(*r*, *g*, *b*, *a*) -> *int*</code><br>
|
|
52
82
|
<code>hex_to_rgba(*hex_int*) -> *tuple*</code><br>
|
|
53
83
|
<code>luminance(*r*, *g*, *b*, *precision*, *round_to*) -> *float*|*int*</code>
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*
|
|
84
|
+
* fixed the `grayscale()` method of `rgba()`, `hsla()` and `hexa()`:<br>
|
|
85
|
+
the method would previously just return the color, fully desaturated (*not grayscale*)<br>
|
|
86
|
+
now this is fixed, and the method uses the luminance formula, to get the actual grayscale value
|
|
87
|
+
* all the methods in the `xx_color` module now support HEXA integers (*e.g.* `0x8085FF` *instead of only strings:* `"#8085FF"` `"0x8085FF"`)
|
|
58
88
|
|
|
59
89
|
## 28.10.2024 `v1.5.2`
|
|
60
|
-
*
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
`Color.is_valid_rgba()`and `Color.is_valid_hsla()` would not accept an alpha channel of `None
|
|
90
|
+
* new parameter <code>correct_path:*bool*</code> in `Path.extend()`:
|
|
91
|
+
this makes sure, that typos in the path will only be corrected if this parameter is set to `True`
|
|
92
|
+
* fFixed bug in `Path.extend()`, where an empty string was taken as a valid path for the current directory `./`
|
|
93
|
+
* fixed color validation bug:<br>
|
|
94
|
+
`Color.is_valid_rgba()`and `Color.is_valid_hsla()` would not accept an alpha channel of `None`<br>
|
|
65
95
|
`Color.is_valid_rgba()` was still checking for an alpha channel from `0` to `255` instead of `0` to `1`
|
|
66
|
-
*
|
|
67
|
-
|
|
96
|
+
* fixed bug for `Color.has_alpha()`:<br>
|
|
97
|
+
previously, it would return `True` if the alpha channel was `None`<br>
|
|
98
|
+
now in such cases it will return `False`
|
|
68
99
|
|
|
69
100
|
## 28.10.2024 `v1.5.1`
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
|
|
101
|
+
* renamed all library files for a better naming convention
|
|
102
|
+
* now all methods in `xx_color` support both HEX prefixes (`#` *and* `0x`)
|
|
103
|
+
* added the default HEX prefix to `_consts_.py`
|
|
104
|
+
* fixed bug when initializing a `hexa()` object:<br>
|
|
105
|
+
would throw an error, even if the color was valid
|
|
75
106
|
|
|
76
107
|
## 27.10.2024 `v1.5.0`
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
108
|
+
* split all classes into separate files, so users can download only parts of the library more easily
|
|
109
|
+
* added a `__help__.py` file, which will show some information about the library and how to use it, when it's run as a script or when the `help()` function is called
|
|
110
|
+
* added a lot more metadata to the library:<br>
|
|
80
111
|
`__version__` (*was already added in update [v1.4.2](#update-1-4-2)*)<br>
|
|
81
112
|
`__author__`<br>
|
|
82
113
|
`__email__`<br>
|
|
@@ -88,22 +119,22 @@
|
|
|
88
119
|
|
|
89
120
|
## <span id="update-1-4-2">27.10.2024 `v1.4.2` `v1.4.3`</span>
|
|
90
121
|
* <code>Path.extend(*rel_path*) -> *abs_path*</code> now also extends system variables like `%USERPROFILE%` and `%APPDATA%`
|
|
91
|
-
*
|
|
92
|
-
*
|
|
122
|
+
* removed unnecessary parts when checking for missing required libraries
|
|
123
|
+
* you can now get the libraries current version by accessing the attribute `XulbuX.__version__`
|
|
93
124
|
|
|
94
125
|
## 26.10.2024 `v1.4.1`
|
|
95
|
-
*
|
|
126
|
+
* added methods to each color type:<br>
|
|
96
127
|
<code>is_grayscale() -> *self*</code><br>
|
|
97
128
|
<code>is_opaque() -> *self*</code>
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
129
|
+
* added additional error checking to the color types
|
|
130
|
+
* made error messages for the color types clearer
|
|
131
|
+
* updated the <code>blend(*other*, *ratio*)</code> method of all color types to use additive blending except for the alpha-channel
|
|
132
|
+
* fixed problem with method-chaining for all color types
|
|
102
133
|
|
|
103
134
|
## 25.10.2024 `v1.4.0`
|
|
104
|
-
*
|
|
105
|
-
-
|
|
106
|
-
-
|
|
135
|
+
* huge update to the custom color types:
|
|
136
|
+
- now all type-methods support chaining
|
|
137
|
+
- added new methods to each type:<br>
|
|
107
138
|
<code>lighten(*amount*) -> *self*</code><br>
|
|
108
139
|
<code>darken(*amount*) -> *self*</code><br>
|
|
109
140
|
<code>saturate(*amount*) -> *self*</code><br>
|
|
@@ -118,7 +149,7 @@
|
|
|
118
149
|
<code>complementary() -> *self*</code>
|
|
119
150
|
|
|
120
151
|
## 23.10.2024 `v1.3.1`
|
|
121
|
-
*
|
|
152
|
+
* now rounds the alpha channel to maximal 2 decimals, if converting from `hexa()` to `rgba()` or `hsla()`
|
|
122
153
|
|
|
123
154
|
## 21.10.2024 `v1.3.0`
|
|
124
155
|
* fixed the custom types `rgba()`, `hsla()` and `hexa()`:<br>
|
|
@@ -131,12 +162,12 @@
|
|
|
131
162
|
- `hexa()`:<br>
|
|
132
163
|
the method `to_rgba()` works correctly now<br>
|
|
133
164
|
the method `to_hsla()` works correctly now
|
|
134
|
-
* fixed
|
|
165
|
+
* fixed methods from the `Color` class:<br>
|
|
135
166
|
`Color.has_alpha()` works correctly now<br>
|
|
136
167
|
`Color.to_rgba()` works correctly now<br>
|
|
137
168
|
`Color.to_hsla()` works correctly now<br>
|
|
138
169
|
`Color.to_hexa()` works correctly now
|
|
139
|
-
* set default value for param `allow_alpha:bool` to `True` for
|
|
170
|
+
* set default value for param `allow_alpha:bool` to `True` for methods:<br>
|
|
140
171
|
`Color.is_valid_rgba()`, `Color.is_valid_hsla()`, `Color.is_valid_hexa()`, `Color.is_valid()`
|
|
141
172
|
|
|
142
173
|
## 18.10.2024 `v1.2.4` `v1.2.5`
|
|
@@ -151,28 +182,28 @@
|
|
|
151
182
|
* `README.md` improvements
|
|
152
183
|
|
|
153
184
|
## 18.10.2024 `v1.2.1` `v1.2.2`
|
|
154
|
-
* fixed bug in
|
|
185
|
+
* fixed bug in method <code>Path.get(*base_dir*=True)</code>:<br>
|
|
155
186
|
Previously, setting `base_dir` to `True` would not return the actual base directory or even cause an error.<br>
|
|
156
187
|
This was now fixed, and setting `base_dir` to `True` will return the actual base directory of the current program (*except if not running from a file*).
|
|
157
188
|
|
|
158
189
|
## 17.10.2024 `v1.2.0`
|
|
159
|
-
* new
|
|
190
|
+
* new method in the `Path` class: `Path.remove()`
|
|
160
191
|
|
|
161
192
|
## 17.10.2024 `v1.1.9`
|
|
162
193
|
* corrected the naming of classes to comply with Python naming standards
|
|
163
194
|
|
|
164
195
|
## 17.10.2024 `v1.1.8`
|
|
165
|
-
* added support for all OSes to the OS-dependent
|
|
196
|
+
* added support for all OSes to the OS-dependent methods
|
|
166
197
|
|
|
167
198
|
## 17.10.2024 `v1.1.6` `v1.1.7`
|
|
168
|
-
* fixed the `Cmd.cls()`
|
|
199
|
+
* fixed the `Cmd.cls()` method:<br>
|
|
169
200
|
There was a bug where, on Windows 10, the ANSI formats weren't cleared.
|
|
170
201
|
|
|
171
202
|
## 17.10.2024 `v1.1.4` `v1.1.5`
|
|
172
203
|
* added link to `CHANGELOG.md` to the `README.md` file
|
|
173
204
|
|
|
174
205
|
## 17.10.2024 `v1.1.3`
|
|
175
|
-
* changed the default value of the param `compactness:int` in the
|
|
206
|
+
* changed the default value of the param `compactness:int` in the method `Data.print()` to `1` instead of `0`
|
|
176
207
|
|
|
177
208
|
## 17.10.2024 `v1.1.1` `v1.1.2`
|
|
178
209
|
* adjusted the library's description
|
|
@@ -194,7 +225,7 @@
|
|
|
194
225
|
prints: <code><u>(Automatically resetting) following text</u></code>
|
|
195
226
|
|
|
196
227
|
## 16.10.2024 `v1.0.7` `v1.0.8`
|
|
197
|
-
* added `input()`
|
|
228
|
+
* added `input()` method to the `FormatCodes` class, so you can make pretty looking input prompts
|
|
198
229
|
* added warning for no network connection when trying to [install missing libraries](#improved-lib-importing)
|
|
199
230
|
|
|
200
231
|
## 15.10.2024 `v1.0.6`
|
|
@@ -282,6 +313,6 @@ from XulbuX import rgb, hsl, hexa
|
|
|
282
313
|
border-radius: 0.2em;
|
|
283
314
|
text-align: center;
|
|
284
315
|
justify-content: center;
|
|
285
|
-
">🠩</div>
|
|
316
|
+
"><span style="display:none">go to top </span>🠩</div>
|
|
286
317
|
</abbr></a>
|
|
287
318
|
</div>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
|
-
Name:
|
|
3
|
-
Version: 1.5.
|
|
2
|
+
Name: xulbux
|
|
3
|
+
Version: 1.5.8
|
|
4
4
|
Summary: A library which includes a lot of really helpful functions.
|
|
5
|
-
Project-URL: Homepage, https://github.com/XulbuX-dev/
|
|
6
|
-
Project-URL: Bug Reports, https://github.com/XulbuX-dev/
|
|
7
|
-
Project-URL: Documentation, https://github.com/XulbuX-dev/
|
|
8
|
-
Project-URL: Source Code, https://github.com/XulbuX-dev/
|
|
9
|
-
Project-URL: Changelog, https://github.com/XulbuX-dev/
|
|
5
|
+
Project-URL: Homepage, https://github.com/XulbuX-dev/PythonLibraryXulbuX
|
|
6
|
+
Project-URL: Bug Reports, https://github.com/XulbuX-dev/PythonLibraryXulbuX/issues
|
|
7
|
+
Project-URL: Documentation, https://github.com/XulbuX-dev/PythonLibraryXulbuX/wiki
|
|
8
|
+
Project-URL: Source Code, https://github.com/XulbuX-dev/PythonLibraryXulbuX/tree/main/src
|
|
9
|
+
Project-URL: Changelog, https://github.com/XulbuX-dev/PythonLibraryXulbuX/blob/main/CHANGELOG.md
|
|
10
10
|
Author-email: XulbuX <xulbux.real@gmail.com>
|
|
11
11
|
License: MIT License
|
|
12
12
|
|
|
@@ -29,7 +29,7 @@ License: MIT License
|
|
|
29
29
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
30
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
31
|
SOFTWARE.
|
|
32
|
-
Keywords: classes,cmd,code,color,data,env,environment,file,format,functions,helper,
|
|
32
|
+
Keywords: classes,cmd,code,color,data,env,environment,file,format,functions,helper,json,library,methods,operations,path,presets,python,regex,string,structures,system,tools,types,utility,xulbux
|
|
33
33
|
Classifier: Intended Audience :: Developers
|
|
34
34
|
Classifier: License :: OSI Approved :: MIT License
|
|
35
35
|
Classifier: Operating System :: OS Independent
|
|
@@ -41,24 +41,28 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
41
41
|
Requires-Python: >=3.10.0
|
|
42
42
|
Requires-Dist: keyboard>=0.13.5
|
|
43
43
|
Requires-Dist: mouse>=0.7.1
|
|
44
|
+
Requires-Dist: pyperclip>=1.9.0
|
|
44
45
|
Requires-Dist: regex>=2023.10.3
|
|
45
46
|
Provides-Extra: dev
|
|
46
|
-
Requires-Dist:
|
|
47
|
+
Requires-Dist: black>=23.7.0; extra == 'dev'
|
|
48
|
+
Requires-Dist: flake8>=6.1.0; extra == 'dev'
|
|
49
|
+
Requires-Dist: isort>=5.12.0; extra == 'dev'
|
|
50
|
+
Requires-Dist: pytest>=7.4.2; extra == 'dev'
|
|
47
51
|
Description-Content-Type: text/markdown
|
|
48
52
|
|
|
49
53
|
# **$\color{#8085FF}\Huge\textsf{XulbuX}$**
|
|
50
54
|
|
|
51
55
|
**$\color{#8085FF}\textsf{XulbuX}$** is a library which includes a lot of really helpful classes, types and functions.
|
|
52
56
|
|
|
53
|
-
For the libraries latest changes, see the [change log](https://github.com/XulbuX-dev/
|
|
54
|
-
For precise information about the library, see the library's [Wiki page](https://github.com/XulbuX-dev/
|
|
57
|
+
For the libraries latest changes, see the [change log](https://github.com/XulbuX-dev/PythonLibraryXulbuX/blob/main/CHANGELOG.md).<br>
|
|
58
|
+
For precise information about the library, see the library's [Wiki page](https://github.com/XulbuX-dev/PythonLibraryXulbuX/wiki).
|
|
55
59
|
|
|
56
60
|
|
|
57
61
|
## Installation
|
|
58
62
|
|
|
59
63
|
On all operating systems, run the following command:
|
|
60
64
|
```bash
|
|
61
|
-
pip install
|
|
65
|
+
pip install xulbux
|
|
62
66
|
```
|
|
63
67
|
|
|
64
68
|
|
|
@@ -66,9 +70,9 @@ pip install XulbuX
|
|
|
66
70
|
|
|
67
71
|
```python
|
|
68
72
|
# GENERAL LIBRARY
|
|
69
|
-
import
|
|
73
|
+
import xulbux as xx
|
|
70
74
|
# CUSTOM TYPES
|
|
71
|
-
from
|
|
75
|
+
from xulbux import rgba, hsla, hexa
|
|
72
76
|
```
|
|
73
77
|
The library **$\color{#8085FF}\textsf{XulbuX}$** (*below used as* `xx` *with above imported types*) contains the following modules:
|
|
74
78
|
```python
|
|
@@ -80,12 +84,12 @@ The library **$\color{#8085FF}\textsf{XulbuX}$** (*below used as* `xx` *with abo
|
|
|
80
84
|
• FILE OPERATIONS xx.File
|
|
81
85
|
• JSON FILE OPERATIONS xx.Json
|
|
82
86
|
• SYSTEM ACTIONS xx.System
|
|
83
|
-
• MANAGE
|
|
84
|
-
•
|
|
85
|
-
• PRETTY PRINTING
|
|
86
|
-
•
|
|
87
|
+
• MANAGE THE ENV PATH VAR xx.EnvPath
|
|
88
|
+
• CONSOLE LOG AND ACTIONS xx.Console
|
|
89
|
+
• EASY PRETTY PRINTING xx.FormatCodes
|
|
90
|
+
• WORKING WITH COLORS xx.Color
|
|
87
91
|
• DATA OPERATIONS xx.Data
|
|
88
|
-
•
|
|
92
|
+
• STRING OPERATIONS xx.String
|
|
89
93
|
• CODE STRING OPERATIONS xx.Code
|
|
90
94
|
• REGEX PATTERN TEMPLATES xx.Regex
|
|
91
95
|
```
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
**$\color{#8085FF}\textsf{XulbuX}$** is a library which includes a lot of really helpful classes, types and functions.
|
|
4
4
|
|
|
5
|
-
For the libraries latest changes, see the [change log](https://github.com/XulbuX-dev/
|
|
6
|
-
For precise information about the library, see the library's [Wiki page](https://github.com/XulbuX-dev/
|
|
5
|
+
For the libraries latest changes, see the [change log](https://github.com/XulbuX-dev/PythonLibraryXulbuX/blob/main/CHANGELOG.md).<br>
|
|
6
|
+
For precise information about the library, see the library's [Wiki page](https://github.com/XulbuX-dev/PythonLibraryXulbuX/wiki).
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
11
|
On all operating systems, run the following command:
|
|
12
12
|
```bash
|
|
13
|
-
pip install
|
|
13
|
+
pip install xulbux
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
|
|
@@ -18,9 +18,9 @@ pip install XulbuX
|
|
|
18
18
|
|
|
19
19
|
```python
|
|
20
20
|
# GENERAL LIBRARY
|
|
21
|
-
import
|
|
21
|
+
import xulbux as xx
|
|
22
22
|
# CUSTOM TYPES
|
|
23
|
-
from
|
|
23
|
+
from xulbux import rgba, hsla, hexa
|
|
24
24
|
```
|
|
25
25
|
The library **$\color{#8085FF}\textsf{XulbuX}$** (*below used as* `xx` *with above imported types*) contains the following modules:
|
|
26
26
|
```python
|
|
@@ -32,12 +32,12 @@ The library **$\color{#8085FF}\textsf{XulbuX}$** (*below used as* `xx` *with abo
|
|
|
32
32
|
• FILE OPERATIONS xx.File
|
|
33
33
|
• JSON FILE OPERATIONS xx.Json
|
|
34
34
|
• SYSTEM ACTIONS xx.System
|
|
35
|
-
• MANAGE
|
|
36
|
-
•
|
|
37
|
-
• PRETTY PRINTING
|
|
38
|
-
•
|
|
35
|
+
• MANAGE THE ENV PATH VAR xx.EnvPath
|
|
36
|
+
• CONSOLE LOG AND ACTIONS xx.Console
|
|
37
|
+
• EASY PRETTY PRINTING xx.FormatCodes
|
|
38
|
+
• WORKING WITH COLORS xx.Color
|
|
39
39
|
• DATA OPERATIONS xx.Data
|
|
40
|
-
•
|
|
40
|
+
• STRING OPERATIONS xx.String
|
|
41
41
|
• CODE STRING OPERATIONS xx.Code
|
|
42
42
|
• REGEX PATTERN TEMPLATES xx.Regex
|
|
43
43
|
```
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<br id="top">
|
|
2
|
+
|
|
3
|
+
**$\color{#8085FF}\Huge\textsf{XulbuX}$**
|
|
4
|
+
|
|
5
|
+
-------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
**$\color{#8085FF}\textsf{XulbuX}$** is a library which includes a lot of really helpful classes, types and functions.<br>
|
|
8
|
+
For the libraries latest changes, see the [change log](https://github.com/XulbuX-dev/PythonLibraryXulbuX/blob/main/CHANGELOG.md).
|
|
9
|
+
|
|
10
|
+
<br>
|
|
11
|
+
|
|
12
|
+
# Installation
|
|
13
|
+
|
|
14
|
+
Open a console and run the command:
|
|
15
|
+
```css
|
|
16
|
+
pip install xulbux
|
|
17
|
+
```
|
|
18
|
+
This should install the latest version of the library, along with some other required libraries.<br>
|
|
19
|
+
To upgrade the library (*if there is a new release*) run the following command in your console:
|
|
20
|
+
```css
|
|
21
|
+
pip install --upgrade xulbux
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
<br>
|
|
25
|
+
|
|
26
|
+
# Usage
|
|
27
|
+
|
|
28
|
+
This imports the full library under the alias `xx`, so it's classes, types and functions are accessible with `xx.Class.method()`, `xx.type()` and `xx.function()`:
|
|
29
|
+
```python
|
|
30
|
+
import xulbux as xx
|
|
31
|
+
```
|
|
32
|
+
So you don't have to write `xx` in front of the library's types, you can import them directly:
|
|
33
|
+
```python
|
|
34
|
+
from xulbux import rgba, hsla, hexa
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
<br>
|
|
38
|
+
|
|
39
|
+
# Modules
|
|
40
|
+
|
|
41
|
+
| | |
|
|
42
|
+
| :------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------- |
|
|
43
|
+
| <h3>[`xx_code`](https://github.com/XulbuX-dev/PythonLibraryXulbuX/wiki/xx_code)</h3> | code-string operations (*changing the indent, finding function calls, ...*) |
|
|
44
|
+
| <h3>[`xx_color`](https://github.com/XulbuX-dev/PythonLibraryXulbuX/wiki/xx_color)</h3> | everything around colors (*converting, blending, searching colors in strings, ...*) |
|
|
45
|
+
| <h3>[`xx_console`](https://github.com/XulbuX-dev/PythonLibraryXulbuX/wiki/xx_console)</h3> | all sorts of actions related to the console (*pretty logging, advanced inputs, ...*) |
|
|
46
|
+
| <h3>[`xx_data`](https://github.com/XulbuX-dev/PythonLibraryXulbuX/wiki/xx_data)</h3> | operations with data structures (*compare, generate path ID's, pretty print/format, ...*) |
|
|
47
|
+
| <h3>[`xx_env_path`](https://github.com/XulbuX-dev/PythonLibraryXulbuX/wiki/xx_env_path)</h3> | getting and editing the PATH variable (*get paths, check for paths, add paths, ...*) |
|
|
48
|
+
<!--
|
|
49
|
+
| <h3>[`xx_string`](https://github.com/XulbuX-dev/PythonLibraryXulbuX/wiki/xx_string)</h3> | helpful actions when working with strings. (*normalize, escape, decompose, ...*) |
|
|
50
|
+
-->
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<br>
|
|
55
|
+
<br>
|
|
56
|
+
|
|
57
|
+
--------------------------------------------------------------
|
|
58
|
+
[View this library on PyPI](https://pypi.org/project/XulbuX/)
|
|
59
|
+
|
|
60
|
+
<div style="width:45px; height:45px; right:10px; position:absolute">
|
|
61
|
+
<a href="#top"><abbr title="go to top" style="text-decoration:none">
|
|
62
|
+
<div style="
|
|
63
|
+
font-size: 2em;
|
|
64
|
+
font-weight: bold;
|
|
65
|
+
background: #88889845;
|
|
66
|
+
border-radius: 0.2em;
|
|
67
|
+
text-align: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
"><span style="display:none">go to top </span>🠩</div>
|
|
70
|
+
</abbr></a>
|
|
71
|
+
</div>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# `Code`
|
|
2
|
+
This class includes methods, used to work with strings, which include code.
|
|
3
|
+
|
|
4
|
+
<br>
|
|
5
|
+
|
|
6
|
+
### `Code.add_indent()`
|
|
7
|
+
|
|
8
|
+
This method will add `indent` spaces at the beginning of each line.<br>
|
|
9
|
+
**Params:**
|
|
10
|
+
- <code>code: *str*</code> the string to add the indent to
|
|
11
|
+
- <code>indent: *int*</code> the amount of spaces to add (*default* `4`)
|
|
12
|
+
|
|
13
|
+
**Returns:** the indented string
|
|
14
|
+
|
|
15
|
+
<br>
|
|
16
|
+
|
|
17
|
+
### `Code.get_tab_spaces()`
|
|
18
|
+
|
|
19
|
+
This method will try to get the amount of spaces that are used for indentation.<br>
|
|
20
|
+
**Param:** <code>code: *str*</code> the string to get the tab spaces from<br>
|
|
21
|
+
**Returns:** the amount of spaces used for indentation
|
|
22
|
+
|
|
23
|
+
<br>
|
|
24
|
+
|
|
25
|
+
### `Code.change_tab_size()`
|
|
26
|
+
|
|
27
|
+
This method will change the amount of spaces used for indentation.<br>
|
|
28
|
+
**Params:**
|
|
29
|
+
- <code>code: *str*</code> the string to change the tab size of
|
|
30
|
+
- <code>new_tab_size: *int*</code> the amount of spaces to use for indentation
|
|
31
|
+
- <code>remove_empty_lines: *bool*</code> whether to remove empty lines in the process
|
|
32
|
+
|
|
33
|
+
**Returns:** the string with the new tab size (*and no empty lines if* `remove_empty_lines` *is true*)
|
|
34
|
+
|
|
35
|
+
<br>
|
|
36
|
+
|
|
37
|
+
### `Code.get_func_calls()`
|
|
38
|
+
|
|
39
|
+
This method will try to get all the function/method calls (*JavaScript, Python, etc. style functions/methods*).<br>
|
|
40
|
+
**Param:** <code>code: *str*</code> the string to get the function/method calls from<br>
|
|
41
|
+
**Returns:** a list of function/method calls
|
|
42
|
+
|
|
43
|
+
<br>
|
|
44
|
+
|
|
45
|
+
### `Code.is_js()`
|
|
46
|
+
|
|
47
|
+
This method will check if the code is likely to be JavaScript.<br>
|
|
48
|
+
**Param:** <code>code: *str*</code> the string to check<br>
|
|
49
|
+
**Returns:** `True` if the code is likely to be JavaScript and `False` otherwise
|