xulbux 1.5.5__py3-none-any.whl → 1.5.7__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/__init__.py CHANGED
@@ -19,19 +19,29 @@
19
19
  • REGEX PATTERN TEMPLATES xx.Regex
20
20
  """
21
21
 
22
- __version__ = '1.5.5'
23
- __author__ = 'XulbuX'
24
- __email__ = 'xulbux.real@gmail.com'
25
- __license__ = 'MIT'
26
- __copyright__ = 'Copyright (c) 2024 XulbuX'
27
- __url__ = 'https://github.com/XulbuX-dev/Python/tree/main/Libraries/XulbuX'
28
- __description__ = 'A library which includes a lot of really helpful functions.'
22
+ __version__ = "1.5.7"
23
+ __author__ = "XulbuX"
24
+ __email__ = "xulbux.real@gmail.com"
25
+ __license__ = "MIT"
26
+ __copyright__ = "Copyright (c) 2024 XulbuX"
27
+ __url__ = "https://github.com/XulbuX-dev/Python/tree/main/Libraries/XulbuX"
28
+ __description__ = "A library which includes a lot of really helpful functions."
29
29
  __all__ = [
30
- '__help__', '_consts_', 'xx_cmd', 'xx_code', 'xx_color', 'xx_data', 'xx_env_vars', 'xx_file',
31
- 'xx_format_codes', 'xx_json', 'xx_path', 'xx_regex', 'xx_string', 'xx_system'
30
+ "_consts_",
31
+ "xx_cmd",
32
+ "xx_code",
33
+ "xx_color",
34
+ "xx_data",
35
+ "xx_env_vars",
36
+ "xx_file",
37
+ "xx_format_codes",
38
+ "xx_json",
39
+ "xx_path",
40
+ "xx_regex",
41
+ "xx_string",
42
+ "xx_system",
32
43
  ]
33
44
 
34
- from .__help__ import help
35
45
  from ._consts_ import *
36
46
  from .xx_cmd import *
37
47
  from .xx_code import *
@@ -1,42 +1,24 @@
1
- try: from ._consts_ import DEFAULT
2
- except: from _consts_ import DEFAULT
3
- try: from .xx_format_codes import *
4
- except: from xx_format_codes import *
5
- try: from .xx_cmd import *
6
- except: from xx_cmd import *
1
+ from . import __version__
2
+ from ._consts_ import DEFAULT
3
+ from .xx_format_codes import *
4
+ from .xx_cmd import *
7
5
 
8
- import os as _os
9
6
 
10
-
11
-
12
-
13
- def get_version(file:str = '__init__.py', var:str = '__version__') -> str:
14
- try:
15
- from . import var
16
- return var
17
- except ImportError:
18
- init_path = _os.path.join(_os.path.dirname(__file__), file)
19
- if _os.path.isfile(init_path):
20
- with open(init_path, encoding='utf-8') as f:
21
- for line in f:
22
- if line.startswith(var): return line.split('=')[-1].strip().strip('\'"')
23
- return 'unknown'
24
-
25
- def help():
7
+ def help_command():
26
8
  """Show some info about the library, with a brief explanation of how to use it."""
27
9
  color = {
28
- 'lib': DEFAULT.color['ice'],
29
- 'import': DEFAULT.color['red'],
30
- 'class': DEFAULT.color['lavender'],
31
- 'types': DEFAULT.color['lightblue'],
32
- 'punctuators': DEFAULT.color['darkgray'],
10
+ "lib": DEFAULT.color["ice"],
11
+ "import": DEFAULT.color["red"],
12
+ "class": DEFAULT.color["lavender"],
13
+ "types": DEFAULT.color["lightblue"],
14
+ "punctuators": DEFAULT.color["darkgray"],
33
15
  }
34
16
  FormatCodes.print(
35
- rf''' [_|b|#7075FF] __ __
17
+ rf""" [_|b|#7075FF] __ __
36
18
  [b|#7075FF] _ __ __ __/ / / /_ __ ___ __
37
19
  [b|#7075FF] | |/ // / / / / / __ \/ / / | |/ /
38
- [b|#7075FF] > , </ /_/ / /_/ /_/ / /_/ /> , <
39
- [b|#7075FF]/_/|_|\____/\__/\____/\____//_/|_| [*|BG:{DEFAULT.color['gray']}|#000] v[b]{get_version()} [*]
20
+ [b|#7075FF] > , </ /_/ / /_/ /_/ / /_/ /> , <
21
+ [b|#7075FF]/_/|_|\____/\__/\____/\____//_/|_| [*|BG:{DEFAULT.color['gray']}|#000] v[b]{__version__} [*]
40
22
 
41
23
  [i|{DEFAULT.color['coral']}]A TON OF COOL FUNCTIONS, YOU NEED![*]
42
24
 
@@ -65,10 +47,6 @@ def help():
65
47
  [dim](•) REGEX PATTERN TEMPLATES [{color['lib']}]xx[{color['punctuators']}].[{color['class']}]Regex[*]
66
48
  [_]
67
49
  [dim](Press any key to exit...)
68
- ''', DEFAULT.text_color)
50
+ """
51
+ )
69
52
  Cmd.pause_exit(pause=True)
70
-
71
-
72
-
73
- if __name__ == '__main__':
74
- help()
xulbux/_consts_.py CHANGED
@@ -1,147 +1,144 @@
1
1
  class DEFAULT:
2
2
 
3
- text_color:str = '#95B5FF'
4
- color:dict[str,str] = {
5
- 'white': '#F1F2FF',
6
- 'lightgray': '#B6B7C0',
7
- 'gray': '#7B7C8D',
8
- 'darkgray': '#67686C',
9
- 'black': '#202125',
10
- 'red': '#FF606A',
11
- 'coral': '#FF7069',
12
- 'orange': '#FF876A',
13
- 'tangerine': '#FF9962',
14
- 'gold': '#FFAF60',
15
- 'yellow': '#FFD260',
16
- 'green': '#7EE787',
17
- 'teal': '#50EAAF',
18
- 'cyan': '#3EE6DE',
19
- 'ice': '#77EFEF',
20
- 'lightblue': '#60AAFF',
21
- 'blue': '#8085FF',
22
- 'lavender': '#9B7DFF',
23
- 'purple': '#AD68FF',
24
- 'magenta': '#C860FF',
25
- 'pink': '#EE60BB',
26
- 'rose': '#FF6090',
3
+ text_color: str = "#95B5FF"
4
+ color: dict[str, str] = {
5
+ "white": "#F1F2FF",
6
+ "lightgray": "#B6B7C0",
7
+ "gray": "#7B7C8D",
8
+ "darkgray": "#67686C",
9
+ "black": "#202125",
10
+ "red": "#FF606A",
11
+ "coral": "#FF7069",
12
+ "orange": "#FF876A",
13
+ "tangerine": "#FF9962",
14
+ "gold": "#FFAF60",
15
+ "yellow": "#FFD260",
16
+ "green": "#7EE787",
17
+ "teal": "#50EAAF",
18
+ "cyan": "#3EE6DE",
19
+ "ice": "#77EFEF",
20
+ "lightblue": "#60AAFF",
21
+ "blue": "#8085FF",
22
+ "lavender": "#9B7DFF",
23
+ "purple": "#AD68FF",
24
+ "magenta": "#C860FF",
25
+ "pink": "#EE60BB",
26
+ "rose": "#FF6090",
27
27
  }
28
28
 
29
29
 
30
-
31
-
32
30
  class CHARS:
33
31
 
34
32
  # CODE TO SIGNAL, ALL CHARACTERS ARE ALLOWED
35
- all = '<*allowed>'
33
+ all = "<*allowed>"
36
34
 
37
35
  # DIGIT SETS
38
- digits = '0123456789'
39
- float_digits = digits + '.'
40
- hex_digits = digits + '#abcdefABCDEF'
36
+ digits = "0123456789"
37
+ float_digits = digits + "."
38
+ hex_digits = digits + "#abcdefABCDEF"
41
39
 
42
40
  # LETTER CATEGORIES
43
- lowercase = 'abcdefghijklmnopqrstuvwxyz'
44
- lowercase_extended = lowercase + 'äëïöüÿàèìòùáéíóúýâêîôûãñõåæç'
45
- uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
46
- uppercase_extended = uppercase + 'ÄËÏÖÜÀÈÌÒÙÁÉÍÓÚÝÂÊÎÔÛÃÑÕÅÆÇß'
41
+ lowercase = "abcdefghijklmnopqrstuvwxyz"
42
+ lowercase_extended = lowercase + "äëïöüÿàèìòùáéíóúýâêîôûãñõåæç"
43
+ uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
44
+ uppercase_extended = uppercase + "ÄËÏÖÜÀÈÌÒÙÁÉÍÓÚÝÂÊÎÔÛÃÑÕÅÆÇß"
47
45
 
48
46
  # COMBINED LETTER SETS
49
- letters = lowercase + uppercase
50
- letters_extended = lowercase_extended + uppercase_extended
47
+ letters = lowercase + uppercase
48
+ letters_extended = lowercase_extended + uppercase_extended
51
49
 
52
50
  # ASCII sets
53
- special_ascii = ' !"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
54
- special_ascii_extended = special_ascii + 'ø£Ø×ƒªº¿®¬½¼¡«»░▒▓│┤©╣║╗╝¢¥┐└┴┬├─┼╚╔╩╦╠═╬¤ðÐı┘┌█▄¦▀µþÞ¯´≡­±‗¾¶§÷¸°¨·¹³²■ '
55
- standard_ascii = special_ascii + digits + letters
56
- full_ascii = special_ascii_extended + digits + letters_extended
57
-
58
-
51
+ special_ascii = " !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
52
+ special_ascii_extended = special_ascii + "ø£Ø×ƒªº¿®¬½¼¡«»░▒▓│┤©╣║╗╝¢¥┐└┴┬├─┼╚╔╩╦╠═╬¤ðÐı┘┌█▄¦▀µþÞ¯´≡­±‗¾¶§÷¸°¨·¹³²■ "
53
+ standard_ascii = special_ascii + digits + letters
54
+ full_ascii = special_ascii_extended + digits + letters_extended
59
55
 
60
56
 
61
57
  class ANSI:
62
58
 
63
59
  global CHAR, START, SEP, END
64
60
 
65
- CHAR = char = '\x1b'
66
- START = start = '['
67
- SEP = sep = ';'
68
- END = end = 'm'
61
+ CHAR = char = "\x1b"
62
+ START = start = "["
63
+ SEP = sep = ";"
64
+ END = end = "m"
65
+ modifier = {"lighten": "+l", "darken": "-d"}
69
66
 
70
- def seq(parts:int = 1) -> str:
67
+ def seq(parts: int = 1) -> str:
71
68
  """Generate an ANSI sequence with `parts` amount of placeholders."""
72
- return CHAR + START + SEP.join(['{}' for _ in range(parts)]) + END
69
+ return CHAR + START + SEP.join(["{}" for _ in range(parts)]) + END
73
70
 
74
- seq_color:str = CHAR + START + '38' + SEP + '2' + SEP + '{}' + SEP + '{}' + SEP + '{}' + END
75
- seq_bg_color:str = CHAR + START + '48' + SEP + '2' + SEP + '{}' + SEP + '{}' + SEP + '{}' + END
71
+ seq_color: str = CHAR + START + "38" + SEP + "2" + SEP + "{}" + SEP + "{}" + SEP + "{}" + END
72
+ seq_bg_color: str = CHAR + START + "48" + SEP + "2" + SEP + "{}" + SEP + "{}" + SEP + "{}" + END
76
73
 
77
- color_map:list[str] = [
74
+ color_map: list[str] = [
78
75
  ########### DEFAULT CONSOLE COLOR NAMES ############
79
- 'black',
80
- 'red',
81
- 'green',
82
- 'yellow',
83
- 'blue',
84
- 'magenta',
85
- 'cyan',
86
- 'white'
76
+ "black",
77
+ "red",
78
+ "green",
79
+ "yellow",
80
+ "blue",
81
+ "magenta",
82
+ "cyan",
83
+ "white",
87
84
  ]
88
85
 
89
- codes_map:dict[str|tuple[str], int] = {
86
+ codes_map: dict[str | tuple[str], int] = {
90
87
  ###################### RESETS ######################
91
- '_': 0,
92
- ('_bold','_b'): 22,
93
- ('_dim','_d'): 22,
94
- ('_italic','_i'): 23,
95
- ('_underline','_u'): 24,
96
- ('_double-underline','_du'): 24,
97
- ('_inverse','_invert','_in'): 27,
98
- ('_hidden','_hide','_h'): 28,
99
- ('_strikethrough','_s'): 29,
100
- ('_color','_c'): 39,
101
- ('_background','_bg'): 49,
88
+ "_": 0,
89
+ ("_bold", "_b"): 22,
90
+ ("_dim", "_d"): 22,
91
+ ("_italic", "_i"): 23,
92
+ ("_underline", "_u"): 24,
93
+ ("_double-underline", "_du"): 24,
94
+ ("_inverse", "_invert", "_in"): 27,
95
+ ("_hidden", "_hide", "_h"): 28,
96
+ ("_strikethrough", "_s"): 29,
97
+ ("_color", "_c"): 39,
98
+ ("_background", "_bg"): 49,
102
99
  ################### TEXT FORMATS ###################
103
- ('bold','b'): 1,
104
- ('dim','d'): 2,
105
- ('italic','i'): 3,
106
- ('underline','u'): 4,
107
- ('inverse','invert','in'): 7,
108
- ('hidden','hide','h'): 8,
109
- ('strikethrough','s'): 9,
110
- ('double-underline','du'): 21,
100
+ ("bold", "b"): 1,
101
+ ("dim", "d"): 2,
102
+ ("italic", "i"): 3,
103
+ ("underline", "u"): 4,
104
+ ("inverse", "invert", "in"): 7,
105
+ ("hidden", "hide", "h"): 8,
106
+ ("strikethrough", "s"): 9,
107
+ ("double-underline", "du"): 21,
111
108
  ############## DEFAULT CONSOLE COLORS ##############
112
- 'black': 30,
113
- 'red': 31,
114
- 'green': 32,
115
- 'yellow': 33,
116
- 'blue': 34,
117
- 'magenta': 35,
118
- 'cyan': 36,
119
- 'white': 37,
109
+ "black": 30,
110
+ "red": 31,
111
+ "green": 32,
112
+ "yellow": 33,
113
+ "blue": 34,
114
+ "magenta": 35,
115
+ "cyan": 36,
116
+ "white": 37,
120
117
  ########## BRIGHT DEFAULT CONSOLE COLORS ###########
121
- ('bright:black','br:black'): 90,
122
- ('bright:red','br:red'): 91,
123
- ('bright:green','br:green'): 92,
124
- ('bright:yellow','br:yellow'): 93,
125
- ('bright:blue','br:blue'): 94,
126
- ('bright:magenta','br:magenta'): 95,
127
- ('bright:cyan','br:cyan'): 96,
128
- ('bright:white','br:white'): 97,
118
+ ("bright:black", "br:black"): 90,
119
+ ("bright:red", "br:red"): 91,
120
+ ("bright:green", "br:green"): 92,
121
+ ("bright:yellow", "br:yellow"): 93,
122
+ ("bright:blue", "br:blue"): 94,
123
+ ("bright:magenta", "br:magenta"): 95,
124
+ ("bright:cyan", "br:cyan"): 96,
125
+ ("bright:white", "br:white"): 97,
129
126
  ######## DEFAULT CONSOLE BACKGROUND COLORS #########
130
- 'bg:black': 40,
131
- 'bg:red': 41,
132
- 'bg:green': 42,
133
- 'bg:yellow': 43,
134
- 'bg:blue': 44,
135
- 'bg:magenta': 45,
136
- 'bg:cyan': 46,
137
- 'bg:white': 47,
127
+ "bg:black": 40,
128
+ "bg:red": 41,
129
+ "bg:green": 42,
130
+ "bg:yellow": 43,
131
+ "bg:blue": 44,
132
+ "bg:magenta": 45,
133
+ "bg:cyan": 46,
134
+ "bg:white": 47,
138
135
  ##### BRIGHT DEFAULT CONSOLE BACKGROUND COLORS #####
139
- ('bg:bright:black','bg:br:black'): 100,
140
- ('bg:bright:red','bg:br:red'): 101,
141
- ('bg:bright:green','bg:br:green'): 102,
142
- ('bg:bright:yellow','bg:br:yellow'): 103,
143
- ('bg:bright:blue','bg:br:blue'): 104,
144
- ('bg:bright:magenta','bg:br:magenta'): 105,
145
- ('bg:bright:cyan','bg:br:cyan'): 106,
146
- ('bg:bright:white','bg:br:white'): 107,
136
+ ("bg:bright:black", "bg:br:black"): 100,
137
+ ("bg:bright:red", "bg:br:red"): 101,
138
+ ("bg:bright:green", "bg:br:green"): 102,
139
+ ("bg:bright:yellow", "bg:br:yellow"): 103,
140
+ ("bg:bright:blue", "bg:br:blue"): 104,
141
+ ("bg:bright:magenta", "bg:br:magenta"): 105,
142
+ ("bg:bright:cyan", "bg:br:cyan"): 106,
143
+ ("bg:bright:white", "bg:br:white"): 107,
147
144
  }