xulbux 1.5.7__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.7 → xulbux-1.5.8}/CHANGELOG.md +84 -69
- {xulbux-1.5.7 → xulbux-1.5.8}/PKG-INFO +10 -10
- {xulbux-1.5.7 → xulbux-1.5.8}/README.md +8 -8
- 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.7 → xulbux-1.5.8}/pyproject.toml +11 -5
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/__init__.py +11 -11
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/_cli_.py +10 -10
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/xx_code.py +3 -3
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/xx_color.py +62 -51
- xulbux-1.5.7/src/XulbuX/xx_cmd.py → xulbux-1.5.8/src/XulbuX/xx_console.py +39 -39
- 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.7 → xulbux-1.5.8}/src/XulbuX/xx_file.py +2 -2
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/xx_format_codes.py +2 -3
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/xx_json.py +2 -2
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/xx_regex.py +22 -4
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/xx_string.py +29 -0
- {xulbux-1.5.7 → xulbux-1.5.8}/tests/test_cmd_info.py +4 -4
- xulbux-1.5.8/tests/test_color.py +18 -0
- {xulbux-1.5.7 → xulbux-1.5.8}/tests/test_color_types.py +1 -1
- xulbux-1.5.8/tests/test_data.py +51 -0
- xulbux-1.5.8/tests/test_env_vars.py +25 -0
- xulbux-1.5.7/documentation.md +0 -369
- xulbux-1.5.7/src/XulbuX/xx_data.py +0 -555
- xulbux-1.5.7/src/XulbuX/xx_env_vars.py +0 -73
- {xulbux-1.5.7 → xulbux-1.5.8}/.github/workflows/python-package.yml +0 -0
- {xulbux-1.5.7 → xulbux-1.5.8}/.gitignore +0 -0
- {xulbux-1.5.7 → xulbux-1.5.8}/LICENSE +0 -0
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/_consts_.py +0 -0
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/xx_path.py +0 -0
- {xulbux-1.5.7 → xulbux-1.5.8}/src/XulbuX/xx_system.py +0 -0
|
@@ -15,84 +15,99 @@
|
|
|
15
15
|
# <br><b>Changelog</b><br>
|
|
16
16
|
|
|
17
17
|
|
|
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
|
+
|
|
18
32
|
## 15.11.2024 `v1.5.7`
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
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
|
|
28
42
|
|
|
29
43
|
## 11.11.2024 `v1.5.6`
|
|
30
|
-
*
|
|
31
|
-
*
|
|
44
|
+
* moved the whole library to it's own repository: [PythonLibraryXulbuX](https://github.com/XulbuX-dev/PythonLibraryXulbuX)
|
|
45
|
+
* updated all connections and links
|
|
32
46
|
|
|
33
47
|
## 11.11.2024 `v1.5.5`
|
|
34
|
-
*
|
|
48
|
+
* added methods to get the width and height of the console (*in characters and lines*):<br>
|
|
35
49
|
<code>Cmd.w() -> *int*</code> how many text characters the console is wide<br>
|
|
36
50
|
<code>Cmd.h() -> *int*</code> how many lines the console is high<br>
|
|
37
51
|
<code>Cmd.wh() -> *tuple[int,int]*</code> a tuple with width and height
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
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:
|
|
41
55
|
- paste text from the clipboard
|
|
42
56
|
- select all text to delete everything at once
|
|
43
57
|
- write and backspace over multiple lines
|
|
44
58
|
- not the prompt supports custom format codes
|
|
45
|
-
*
|
|
46
|
-
*
|
|
59
|
+
* added required non-standard libraries to the project file
|
|
60
|
+
* added more metadata to the project file
|
|
47
61
|
|
|
48
62
|
## 06.11.2024 `v1.5.4`
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
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
|
|
58
72
|
|
|
59
73
|
## 30.10.2024 `v1.5.3`
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
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) 🫡:
|
|
64
78
|
- changed the indent to 4 spaces
|
|
65
79
|
- no more inline control statements (*except its only a really small statement and body*)
|
|
66
|
-
*
|
|
80
|
+
* added new methods to `Color`:<br>
|
|
67
81
|
<code>rgba_to_hex(*r*, *g*, *b*, *a*) -> *int*</code><br>
|
|
68
82
|
<code>hex_to_rgba(*hex_int*) -> *tuple*</code><br>
|
|
69
83
|
<code>luminance(*r*, *g*, *b*, *precision*, *round_to*) -> *float*|*int*</code>
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*
|
|
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"`)
|
|
74
88
|
|
|
75
89
|
## 28.10.2024 `v1.5.2`
|
|
76
|
-
*
|
|
77
|
-
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
`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>
|
|
81
95
|
`Color.is_valid_rgba()` was still checking for an alpha channel from `0` to `255` instead of `0` to `1`
|
|
82
|
-
*
|
|
83
|
-
|
|
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`
|
|
84
99
|
|
|
85
100
|
## 28.10.2024 `v1.5.1`
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
|
|
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
|
|
91
106
|
|
|
92
107
|
## 27.10.2024 `v1.5.0`
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
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>
|
|
96
111
|
`__version__` (*was already added in update [v1.4.2](#update-1-4-2)*)<br>
|
|
97
112
|
`__author__`<br>
|
|
98
113
|
`__email__`<br>
|
|
@@ -104,22 +119,22 @@
|
|
|
104
119
|
|
|
105
120
|
## <span id="update-1-4-2">27.10.2024 `v1.4.2` `v1.4.3`</span>
|
|
106
121
|
* <code>Path.extend(*rel_path*) -> *abs_path*</code> now also extends system variables like `%USERPROFILE%` and `%APPDATA%`
|
|
107
|
-
*
|
|
108
|
-
*
|
|
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__`
|
|
109
124
|
|
|
110
125
|
## 26.10.2024 `v1.4.1`
|
|
111
|
-
*
|
|
126
|
+
* added methods to each color type:<br>
|
|
112
127
|
<code>is_grayscale() -> *self*</code><br>
|
|
113
128
|
<code>is_opaque() -> *self*</code>
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
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
|
|
118
133
|
|
|
119
134
|
## 25.10.2024 `v1.4.0`
|
|
120
|
-
*
|
|
121
|
-
-
|
|
122
|
-
-
|
|
135
|
+
* huge update to the custom color types:
|
|
136
|
+
- now all type-methods support chaining
|
|
137
|
+
- added new methods to each type:<br>
|
|
123
138
|
<code>lighten(*amount*) -> *self*</code><br>
|
|
124
139
|
<code>darken(*amount*) -> *self*</code><br>
|
|
125
140
|
<code>saturate(*amount*) -> *self*</code><br>
|
|
@@ -134,7 +149,7 @@
|
|
|
134
149
|
<code>complementary() -> *self*</code>
|
|
135
150
|
|
|
136
151
|
## 23.10.2024 `v1.3.1`
|
|
137
|
-
*
|
|
152
|
+
* now rounds the alpha channel to maximal 2 decimals, if converting from `hexa()` to `rgba()` or `hsla()`
|
|
138
153
|
|
|
139
154
|
## 21.10.2024 `v1.3.0`
|
|
140
155
|
* fixed the custom types `rgba()`, `hsla()` and `hexa()`:<br>
|
|
@@ -147,12 +162,12 @@
|
|
|
147
162
|
- `hexa()`:<br>
|
|
148
163
|
the method `to_rgba()` works correctly now<br>
|
|
149
164
|
the method `to_hsla()` works correctly now
|
|
150
|
-
* fixed
|
|
165
|
+
* fixed methods from the `Color` class:<br>
|
|
151
166
|
`Color.has_alpha()` works correctly now<br>
|
|
152
167
|
`Color.to_rgba()` works correctly now<br>
|
|
153
168
|
`Color.to_hsla()` works correctly now<br>
|
|
154
169
|
`Color.to_hexa()` works correctly now
|
|
155
|
-
* 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>
|
|
156
171
|
`Color.is_valid_rgba()`, `Color.is_valid_hsla()`, `Color.is_valid_hexa()`, `Color.is_valid()`
|
|
157
172
|
|
|
158
173
|
## 18.10.2024 `v1.2.4` `v1.2.5`
|
|
@@ -167,28 +182,28 @@
|
|
|
167
182
|
* `README.md` improvements
|
|
168
183
|
|
|
169
184
|
## 18.10.2024 `v1.2.1` `v1.2.2`
|
|
170
|
-
* fixed bug in
|
|
185
|
+
* fixed bug in method <code>Path.get(*base_dir*=True)</code>:<br>
|
|
171
186
|
Previously, setting `base_dir` to `True` would not return the actual base directory or even cause an error.<br>
|
|
172
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*).
|
|
173
188
|
|
|
174
189
|
## 17.10.2024 `v1.2.0`
|
|
175
|
-
* new
|
|
190
|
+
* new method in the `Path` class: `Path.remove()`
|
|
176
191
|
|
|
177
192
|
## 17.10.2024 `v1.1.9`
|
|
178
193
|
* corrected the naming of classes to comply with Python naming standards
|
|
179
194
|
|
|
180
195
|
## 17.10.2024 `v1.1.8`
|
|
181
|
-
* added support for all OSes to the OS-dependent
|
|
196
|
+
* added support for all OSes to the OS-dependent methods
|
|
182
197
|
|
|
183
198
|
## 17.10.2024 `v1.1.6` `v1.1.7`
|
|
184
|
-
* fixed the `Cmd.cls()`
|
|
199
|
+
* fixed the `Cmd.cls()` method:<br>
|
|
185
200
|
There was a bug where, on Windows 10, the ANSI formats weren't cleared.
|
|
186
201
|
|
|
187
202
|
## 17.10.2024 `v1.1.4` `v1.1.5`
|
|
188
203
|
* added link to `CHANGELOG.md` to the `README.md` file
|
|
189
204
|
|
|
190
205
|
## 17.10.2024 `v1.1.3`
|
|
191
|
-
* 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`
|
|
192
207
|
|
|
193
208
|
## 17.10.2024 `v1.1.1` `v1.1.2`
|
|
194
209
|
* adjusted the library's description
|
|
@@ -210,7 +225,7 @@
|
|
|
210
225
|
prints: <code><u>(Automatically resetting) following text</u></code>
|
|
211
226
|
|
|
212
227
|
## 16.10.2024 `v1.0.7` `v1.0.8`
|
|
213
|
-
* added `input()`
|
|
228
|
+
* added `input()` method to the `FormatCodes` class, so you can make pretty looking input prompts
|
|
214
229
|
* added warning for no network connection when trying to [install missing libraries](#improved-lib-importing)
|
|
215
230
|
|
|
216
231
|
## 15.10.2024 `v1.0.6`
|
|
@@ -1,6 +1,6 @@
|
|
|
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
5
|
Project-URL: Homepage, https://github.com/XulbuX-dev/PythonLibraryXulbuX
|
|
6
6
|
Project-URL: Bug Reports, https://github.com/XulbuX-dev/PythonLibraryXulbuX/issues
|
|
@@ -62,7 +62,7 @@ For precise information about the library, see the library's [Wiki page](https:/
|
|
|
62
62
|
|
|
63
63
|
On all operating systems, run the following command:
|
|
64
64
|
```bash
|
|
65
|
-
pip install
|
|
65
|
+
pip install xulbux
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
|
|
@@ -70,9 +70,9 @@ pip install XulbuX
|
|
|
70
70
|
|
|
71
71
|
```python
|
|
72
72
|
# GENERAL LIBRARY
|
|
73
|
-
import
|
|
73
|
+
import xulbux as xx
|
|
74
74
|
# CUSTOM TYPES
|
|
75
|
-
from
|
|
75
|
+
from xulbux import rgba, hsla, hexa
|
|
76
76
|
```
|
|
77
77
|
The library **$\color{#8085FF}\textsf{XulbuX}$** (*below used as* `xx` *with above imported types*) contains the following modules:
|
|
78
78
|
```python
|
|
@@ -84,12 +84,12 @@ The library **$\color{#8085FF}\textsf{XulbuX}$** (*below used as* `xx` *with abo
|
|
|
84
84
|
• FILE OPERATIONS xx.File
|
|
85
85
|
• JSON FILE OPERATIONS xx.Json
|
|
86
86
|
• SYSTEM ACTIONS xx.System
|
|
87
|
-
• MANAGE
|
|
88
|
-
•
|
|
89
|
-
• PRETTY PRINTING
|
|
90
|
-
•
|
|
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
|
|
91
91
|
• DATA OPERATIONS xx.Data
|
|
92
|
-
•
|
|
92
|
+
• STRING OPERATIONS xx.String
|
|
93
93
|
• CODE STRING OPERATIONS xx.Code
|
|
94
94
|
• REGEX PATTERN TEMPLATES xx.Regex
|
|
95
95
|
```
|
|
@@ -10,7 +10,7 @@ For precise information about the library, see the library's [Wiki page](https:/
|
|
|
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
|