xulbux 1.7.3__py3-none-any.whl → 1.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of xulbux might be problematic. Click here for more details.

xulbux/_consts_.py DELETED
@@ -1,180 +0,0 @@
1
- from dataclasses import dataclass
2
- from typing import TypeAlias
3
-
4
-
5
- FormattableString: TypeAlias = str
6
- """A `str` object that is made to be formatted with the `.format()` method."""
7
-
8
-
9
- @dataclass
10
- class COLOR:
11
- """Color presets used in the `xulbux` library."""
12
-
13
- text = "#A5D6FF"
14
- """The default text color used in the `xulbux` library."""
15
-
16
- white = "#F1F2FF"
17
- lightgray = "#B6B7C0"
18
- gray = "#7B7C8D"
19
- darkgray = "#67686C"
20
- black = "#202125"
21
- red = "#FF606A"
22
- coral = "#FF7069"
23
- orange = "#FF876A"
24
- tangerine = "#FF9962"
25
- gold = "#FFAF60"
26
- yellow = "#FFD260"
27
- lime = "#C9F16E"
28
- green = "#7EE787"
29
- neongreen = "#4CFF85"
30
- teal = "#50EAAF"
31
- cyan = "#3EDEE6"
32
- ice = "#77DBEF"
33
- lightblue = "#60AAFF"
34
- blue = "#8085FF"
35
- lavender = "#9B7DFF"
36
- purple = "#AD68FF"
37
- magenta = "#C860FF"
38
- pink = "#F162EF"
39
- rose = "#FF609F"
40
-
41
-
42
- class _AllTextCharacters:
43
- pass
44
-
45
-
46
- @dataclass
47
- class CHARS:
48
- """Text character sets."""
49
-
50
- all = _AllTextCharacters
51
- """Code to signal that all characters are allowed."""
52
-
53
- digits: str = "0123456789"
54
- """Digits: `0`-`9`"""
55
- float_digits: str = digits + "."
56
- """Digits: `0`-`9` with decimal point `.`"""
57
- hex_digits: str = digits + "#abcdefABCDEF"
58
- """Digits: `0`-`9` Letters: `a`-`f` `A`-`F` and a hashtag `#`"""
59
-
60
- lowercase: str = "abcdefghijklmnopqrstuvwxyz"
61
- """Lowercase letters `a`-`z`"""
62
- lowercase_extended: str = lowercase + "äëïöüÿàèìòùáéíóúýâêîôûãñõåæç"
63
- """Lowercase letters `a`-`z` with all lowercase diacritic letters."""
64
- uppercase: str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
65
- """Uppercase letters `A`-`Z`"""
66
- uppercase_extended: str = uppercase + "ÄËÏÖÜÀÈÌÒÙÁÉÍÓÚÝÂÊÎÔÛÃÑÕÅÆÇß"
67
- """Uppercase letters `A`-`Z` with all uppercase diacritic letters."""
68
-
69
- letters: str = lowercase + uppercase
70
- """Lowercase and uppercase letters `a`-`z` and `A`-`Z`"""
71
- letters_extended: str = lowercase_extended + uppercase_extended
72
- """Lowercase and uppercase letters `a`-`z` `A`-`Z` and all diacritic letters."""
73
-
74
- special_ascii: str = " !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
75
- """All ASCII special characters."""
76
- special_ascii_extended: str = special_ascii + "ø£Ø×ƒªº¿®¬½¼¡«»░▒▓│┤©╣║╗╝¢¥┐└┴┬├─┼╚╔╩╦╠═╬¤ðÐı┘┌█▄¦▀µþÞ¯´≡­±‗¾¶§÷¸°¨·¹³²■ "
77
- """All ASCII special characters with the extended ASCII special characters."""
78
- standard_ascii: str = special_ascii + digits + letters
79
- """All standard ASCII characters."""
80
- full_ascii: str = special_ascii_extended + digits + letters_extended
81
- """All characters in the ASCII table."""
82
-
83
-
84
- class ANSI:
85
- """Constants and class-methods for use of ANSI escape codes."""
86
-
87
- escaped_char: str = "\\x1b"
88
- """The printable ANSI escape character."""
89
- CHAR = char = "\x1b"
90
- """The ANSI escape character."""
91
- START = start = "["
92
- """The start of an ANSI escape sequence."""
93
- SEP = sep = ";"
94
- """The separator between ANSI escape sequence parts."""
95
- END = end = "m"
96
- """The end of an ANSI escape sequence."""
97
-
98
- @classmethod
99
- def seq(cls, parts: int = 1) -> FormattableString:
100
- """Generate an ANSI sequence with `parts` amount of placeholders."""
101
- return cls.CHAR + cls.START + cls.SEP.join(["{}" for _ in range(parts)]) + cls.END
102
-
103
- seq_color: FormattableString = CHAR + START + "38" + SEP + "2" + SEP + "{}" + SEP + "{}" + SEP + "{}" + END
104
- """The ANSI escape sequence for setting the text RGB color."""
105
- seq_bg_color: FormattableString = CHAR + START + "48" + SEP + "2" + SEP + "{}" + SEP + "{}" + SEP + "{}" + END
106
- """The ANSI escape sequence for setting the background RGB color."""
107
-
108
- color_map: tuple[str, ...] = (
109
- ########### DEFAULT CONSOLE COLOR NAMES ############
110
- "black",
111
- "red",
112
- "green",
113
- "yellow",
114
- "blue",
115
- "magenta",
116
- "cyan",
117
- "white",
118
- )
119
- """The console default color names."""
120
-
121
- codes_map: dict[str | tuple[str, ...], int] = {
122
- ################# SPECIFIC RESETS ##################
123
- "_": 0,
124
- ("_bold", "_b"): 22,
125
- ("_dim", "_d"): 22,
126
- ("_italic", "_i"): 23,
127
- ("_underline", "_u"): 24,
128
- ("_double-underline", "_du"): 24,
129
- ("_inverse", "_invert", "_in"): 27,
130
- ("_hidden", "_hide", "_h"): 28,
131
- ("_strikethrough", "_s"): 29,
132
- ("_color", "_c"): 39,
133
- ("_background", "_bg"): 49,
134
- ################### TEXT STYLES ####################
135
- ("bold", "b"): 1,
136
- ("dim", "d"): 2,
137
- ("italic", "i"): 3,
138
- ("underline", "u"): 4,
139
- ("inverse", "invert", "in"): 7,
140
- ("hidden", "hide", "h"): 8,
141
- ("strikethrough", "s"): 9,
142
- ("double-underline", "du"): 21,
143
- ################## DEFAULT COLORS ##################
144
- "black": 30,
145
- "red": 31,
146
- "green": 32,
147
- "yellow": 33,
148
- "blue": 34,
149
- "magenta": 35,
150
- "cyan": 36,
151
- "white": 37,
152
- ############## BRIGHT DEFAULT COLORS ###############
153
- "br:black": 90,
154
- "br:red": 91,
155
- "br:green": 92,
156
- "br:yellow": 93,
157
- "br:blue": 94,
158
- "br:magenta": 95,
159
- "br:cyan": 96,
160
- "br:white": 97,
161
- ############ DEFAULT BACKGROUND COLORS #############
162
- "bg:black": 40,
163
- "bg:red": 41,
164
- "bg:green": 42,
165
- "bg:yellow": 43,
166
- "bg:blue": 44,
167
- "bg:magenta": 45,
168
- "bg:cyan": 46,
169
- "bg:white": 47,
170
- ######### BRIGHT DEFAULT BACKGROUND COLORS #########
171
- "bg:br:black": 100,
172
- "bg:br:red": 101,
173
- "bg:br:green": 102,
174
- "bg:br:yellow": 103,
175
- "bg:br:blue": 104,
176
- "bg:br:magenta": 105,
177
- "bg:br:cyan": 106,
178
- "bg:br:white": 107,
179
- }
180
- """All custom format keys and their corresponding ANSI format number codes."""
@@ -1,173 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: xulbux
3
- Version: 1.7.3
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
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/XulbuX/PythonLibraryXulbuX
8
- Project-URL: Documentation, https://github.com/XulbuX/PythonLibraryXulbuX/wiki
9
- Project-URL: Source Code, https://github.com/XulbuX/PythonLibraryXulbuX/tree/main/src
10
- Project-URL: Changelog, https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/CHANGELOG.md
11
- Project-URL: Bug Reports, https://github.com/XulbuX/PythonLibraryXulbuX/issues
12
- Project-URL: License, https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/LICENSE
13
- 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
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.13
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Programming Language :: Python :: 3.11
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Operating System :: OS Independent
20
- Classifier: Intended Audience :: Developers
21
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
- Requires-Python: >=3.10.0
23
- Description-Content-Type: text/markdown
24
- License-File: LICENSE
25
- Requires-Dist: keyboard>=0.13.5
26
- Requires-Dist: mouse>=0.7.1
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
- Dynamic: license-file
37
-
38
- # **XulbuX**
39
-
40
- ![](https://img.shields.io/pypi/v/xulbux?labelColor=404560&color=7075FF) ![](https://img.shields.io/pypi/dm/xulbux?labelColor=405555&color=70FFEE) ![](https://img.shields.io/github/license/XulbuX/PythonLibraryXulbuX?labelColor=405555&color=70FFEE) ![](https://img.shields.io/github/last-commit/XulbuX/PythonLibraryXulbuX?labelColor=554045&color=FF6065) ![](https://img.shields.io/github/issues/XulbuX/PythonLibraryXulbuX?labelColor=554045&color=FF6065)
41
-
42
- **XulbuX** is library that contains many useful classes, types, and functions,
43
- ranging from console logging and working with colors to file management and system operations.
44
- The library is designed to simplify common programming tasks and improve code readability through its collection of tools.
45
-
46
- For precise information about the library, see the library's [**documentation**](https://github.com/XulbuX/PythonLibraryXulbuX/wiki).<br>
47
- For the libraries latest changes and updates, see the [**change log**](https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/CHANGELOG.md).
48
-
49
- <br>
50
-
51
- ## Installation
52
-
53
- Run the following commands in a console with administrator privileges, so the actions take effect for all users.
54
-
55
- Install the library and all its dependencies with the command:
56
- ```console
57
- pip install xulbux
58
- ```
59
-
60
- Upgrade the library and all its dependencies to their latest available version with the command:
61
- ```console
62
- pip install --upgrade xulbux
63
- ```
64
-
65
- <br>
66
-
67
- ## Usage
68
-
69
- 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()`:
70
- ```python
71
- import xulbux as xx
72
- ```
73
- 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:
74
- ```python
75
- # CONSTANTS
76
- from xulbux import COLOR, CHARS, ANSI
77
- # Classes
78
- from xulbux import Code, Color, Console, ...
79
- # types
80
- from xulbux import rgba, hsla, hexa
81
- ```
82
-
83
- <br>
84
-
85
- ## Modules
86
-
87
- | Module | Short Description |
88
- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------- |
89
- | [![xx_code](https://img.shields.io/badge/xx__code-6065FF?style=flat)](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/xx_code) | advanced code-string operations (*changing the indent, finding function calls, ...*) |
90
- | [![xx_color](https://img.shields.io/badge/xx__color-6065FF?style=flat)](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/xx_color) | everything around colors (*converting, blending, searching colors in strings, ...*) |
91
- | [![xx_console](https://img.shields.io/badge/xx__console-6065FF?style=flat)](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/xx_console) | advanced actions related to the console (*pretty logging, advanced inputs, ...*) |
92
- | [![xx_data](https://img.shields.io/badge/xx__data-6065FF?style=flat)](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/xx_data) | advanced operations with data structures (*compare, generate path ID's, pretty print/format, ...*) |
93
- | [![xx_env_path](https://img.shields.io/badge/xx__env__path-6065FF?style=flat)](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/xx_env_path) | getting and editing the PATH variable (*get paths, check for paths, add paths, ...*) |
94
- | [![xx_file](https://img.shields.io/badge/xx__file-6065FF?style=flat)](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/xx_file) | advanced working with files (*create files, rename file-extensions, ...*) |
95
- | [![xx_format_codes](https://img.shields.io/badge/xx__format__codes-6065FF?style=flat)](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/xx_format_codes) | easy pretty printing with custom format codes (*print, inputs, custom format codes to ANSI, ...*) |
96
- | [![xx_json](https://img.shields.io/badge/xx__json-6065FF?style=flat)](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/xx_json) | advanced working with json files (*read, create, update, ...*) |
97
- | [![xx_path](https://img.shields.io/badge/xx__path-6065FF?style=flat)](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/xx_path) | advanced path operations (*get paths, smart-extend relative paths, delete paths, ...*) |
98
- | ![xx_regex](https://img.shields.io/badge/xx__regex-6065FF?style=flat) | generated regex pattern-templates (*match bracket- and quote pairs, match colors, ...*) |
99
- | [![xx_string](https://img.shields.io/badge/xx__string-6065FF?style=flat)](https://github.com/XulbuX/PythonLibraryXulbuX/wiki/xx_string) | helpful actions when working with strings. (*normalize, escape, decompose, ...*) |
100
- | ![xx_system](https://img.shields.io/badge/xx__system-6065FF?style=flat) | advanced system actions (*restart with message, check installed Python libs, ...*) |
101
-
102
- <br>
103
-
104
- ## Example Usage
105
-
106
- This is what it could look like using this library for a simple but very nice looking color converter:
107
- ```python
108
- from xulbux import COLOR # CONSTANTS
109
- from xulbux import FormatCodes, Console # Classes
110
- from xulbux import hexa # types
111
-
112
-
113
- def main() -> None:
114
-
115
- # LET THE USER ENTER A HEXA COLOR IN ANY HEXA FORMAT
116
- input_clr = FormatCodes.input(
117
- "\n[b](Enter a HEXA color in any format) [dim](>) "
118
- )
119
-
120
- # ANNOUNCE INDEXING THE INPUT COLOR
121
- Console.log(
122
- "INDEX",
123
- "Indexing the input HEXA color...",
124
- start="\n",
125
- title_bg_color=COLOR.blue,
126
- )
127
-
128
- try:
129
- # TRY TO CONVERT THE INPUT COLOR INTO A hexa() COLOR
130
- hexa_color = hexa(input_clr)
131
-
132
- except ValueError:
133
- # ANNOUNCE THE ERROR AND EXIT THE PROGRAM
134
- Console.fail(
135
- "The input HEXA color is invalid.",
136
- end="\n\n",
137
- exit=True,
138
- )
139
-
140
- # ANNOUNCE STARTING THE CONVERSION
141
- Console.log(
142
- "CONVERT",
143
- "Converting the HEXA color into different types...",
144
- title_bg_color=COLOR.tangerine,
145
- )
146
-
147
- # CONVERT THE HEXA COLOR INTO THE TWO OTHER COLOR TYPES
148
- rgba_color = hexa_color.to_rgba()
149
- hsla_color = hexa_color.to_hsla()
150
-
151
- # ANNOUNCE THE SUCCESSFUL CONVERSION
152
- Console.done(
153
- "Successfully converted color into different types.",
154
- end="\n\n",
155
- )
156
-
157
- # PRETTY PRINT THE COLOR IN DIFFERENT TYPES
158
- Console.log_box_bordered(
159
- f"[b](HEXA:) [i|white]({hexa_color})",
160
- f"[b](RGBA:) [i|white]({rgba_color})",
161
- f"[b](HSLA:) [i|white]({hsla_color})",
162
- )
163
-
164
-
165
- if __name__ == "__main__":
166
- main()
167
- ```
168
-
169
- <br>
170
- <br>
171
-
172
- --------------------------------------------------------------
173
- [View this library on **PyPI**](https://pypi.org/project/XulbuX/)
@@ -1,21 +0,0 @@
1
- xulbux/__init__.py,sha256=DLQ3YFjd9sCUw5ZyEiSkkLXs7a-lfbyTrwP4oCaZkDA,815
2
- xulbux/_cli_.py,sha256=J4vfJHLJEYxCZzA_VJUB46w2WGShfdYFoetsLG5PfKo,3428
3
- xulbux/_consts_.py,sha256=4CLJE-YH3si2YQ-IHcjsT5PW0D7vGvm8ZH13rUoG5cE,6166
4
- xulbux/xx_code.py,sha256=b8MJId-BmZOsBH38z-h055op7qIICdsTT3rFJ7SWkiE,6111
5
- xulbux/xx_color.py,sha256=Thj7fFTc8x-VmYyULI3HQW0uCk9dIihwrGUwuXGn83s,49744
6
- xulbux/xx_console.py,sha256=cYlgiyL7oVSPj3TwQXYLhVGVr8yA9vIFsT4uNcE7qNA,34753
7
- xulbux/xx_data.py,sha256=nEfVwK6-ILaL3K-bLezKpG1G7117CY5ZgC3BGwANrUE,30886
8
- xulbux/xx_env_path.py,sha256=x56mKK4lSvU5yMCAs8k0RVIqXWUJcpcHYz5HoZ_RklM,4160
9
- xulbux/xx_file.py,sha256=KerXOvKS93zIoAt36YTYuZboSmxVFVf2WcOrDcdwXfE,2627
10
- xulbux/xx_format_codes.py,sha256=2xYX7Gno49KlalwBhMZYBy9rTZbdsPIcIBnSuYyRGas,24735
11
- xulbux/xx_json.py,sha256=V7vdfpvSe9wpktR_c8zG_Meix7x9IRmn66k5nB3HUyo,7457
12
- xulbux/xx_path.py,sha256=lLAEVZrW0TAwCewlONFVQcQ_8tVn9LTJZVOZpeGvE5s,7673
13
- xulbux/xx_regex.py,sha256=_BtMHRDNcD9zF4SL87dQuUVZcYGfZx9H5YNSDiEtzm8,8059
14
- xulbux/xx_string.py,sha256=QaTo0TQ9m_2USNgQNaVw5ivQt-A1E-e5x8OpIB3xIlY,5561
15
- xulbux/xx_system.py,sha256=Tsx4wgztUg46KloqcGeiFkarDoM3EgJLXw3XNxgHBmU,6460
16
- xulbux-1.7.3.dist-info/licenses/LICENSE,sha256=6NflEcvzFEe8_JFVNCPVwZBwBhlLLd4vqQi8WiX_Xk4,1084
17
- xulbux-1.7.3.dist-info/METADATA,sha256=PBIoTtX3wCvw-w0GOKO32rzvT_BQGB6AdNgNVmQewGw,9705
18
- xulbux-1.7.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- xulbux-1.7.3.dist-info/entry_points.txt,sha256=a3womfLIMZKnOFiyy-xnVb4g2qkZsHR5FbKKkljcGns,94
20
- xulbux-1.7.3.dist-info/top_level.txt,sha256=FkK4EZajwfP36fnlrPaR98OrEvZpvdEOdW1T5zTj6og,7
21
- xulbux-1.7.3.dist-info/RECORD,,
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- xulbux-help = xulbux._cli_:help_command
3
- xx-help = xulbux._cli_:help_command
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 XulbuX
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
File without changes
File without changes
File without changes
File without changes