loopstring 0.0.5__py3-none-any.whl → 0.2.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.
loopstring/loopstring.py CHANGED
@@ -56,7 +56,6 @@ class BOXES:
56
56
  box.append(f"{g['bl']}{g['h'] * (max_width + 2)}{g['br']}")
57
57
  return '\n'.join(box)
58
58
 
59
- # 🚀 NEW SHORTCUTS FOR VERSION 0.0.5 🚀
60
59
  @staticmethod
61
60
  def rounded(text: str) -> str:
62
61
  """Shortcut to draw a rounded box."""
@@ -79,11 +78,12 @@ class BOXES:
79
78
 
80
79
 
81
80
  class SYMBOLS:
82
- """Cool symbols!"""
83
- HEXAGON = '⬢'
84
- PENTAGON = ''
85
- STAR = ''
86
- DOWNLOAD = ''
81
+ """Cool symbols for layouts, dashboards, and loading bars!"""
82
+ # Original Symbols
83
+ HEXAGON = ''
84
+ PENTAGON = ''
85
+ STAR = ''
86
+ DOWNLOAD = '⤓'
87
87
  LIGHTSHADE = '░'
88
88
  MEDIUMSHADE = '▒'
89
89
  DARKSHADE = '▓'
@@ -98,3 +98,188 @@ class SYMBOLS:
98
98
  FILLEDRIGHTTRIANGLE = '▶'
99
99
  RIGHTTRIANGLE = '▷'
100
100
  ASTROIDSTAR = '✦'
101
+
102
+ MONITOR = '🖵' # U+1F5B5 - Physical monitor screen layout
103
+ CLEAR_SCREEN = '⎚' # U+239A - Classic wipe/clear screen icon
104
+ PROMPT = '❯' # U+276F - Modern CLI input hook
105
+ NETWORK = '🛜︎' # U+1F6DC - Wi-Fi/Network status indicator
106
+
107
+ FILL_1_8 = '▏' # U+258F - Left 1/8 block fill
108
+ FILL_1_4 = '▎' # U+258E - Left 1/4 block fill
109
+ FILL_HALF = '▌' # U+258C - Left half block fill
110
+ FILL_3_4 = '▊' # U+258A - Left 3/4 block fill
111
+
112
+ FOLDER_CLOSED = '🗀' # U+1F5C0 - Closed directory item
113
+ FOLDER_OPEN = '🗁' # U+1F5C1 - Expanded directory folder
114
+ DOCUMENT = '🖹' # U+1F5B9 - Log/Text file symbol
115
+ TRASH = '🗑︎' # U+1F5D1 - Delete/Erase storage indicator
116
+
117
+ LOOP_INFINITY = '∞' # U+221E - Infinity track loop
118
+ LOOP_SINGLE = '➰︎' # U+27B0 - Light curly loop curl
119
+ LOOP_DOUBLE = '➿︎' # U+27BF - Double curly loop hook
120
+ LOOP_REFRESH = '⥁' # U+2941 - Circular reload sequence
121
+
122
+ SCALES = '⚖'
123
+
124
+ class DIVIDERS:
125
+ @staticmethod
126
+ def draw_divider(text, style="box"):
127
+ if style == "box":
128
+ return(f"▌[{text}]▐")
129
+ elif style == "server":
130
+ return(f"╽ {text} ╿")
131
+ elif style == "pixel":
132
+ return(f"▀▄ {text} ▄▀")
133
+ elif style == "shade":
134
+ return(f"░▒▓█ {text} █▓▒░")
135
+ elif style == "angle_bracket":
136
+ return(f"❬ {text} ❭")
137
+ elif style == "boxed":
138
+ return(f"┍[ {text} ]┑")
139
+ elif style == "bullet":
140
+ return(f"⁌ {text} ⁍")
141
+ elif style == "dotted_line":
142
+ return(f"⁞ {text} ⁞")
143
+ elif style == "mini_triangle":
144
+ return(f"◂ {text} ▸")
145
+ elif style == "science":
146
+ return(f"⚗⚛ {text} ⚛⚗")
147
+
148
+ class MULTI_INPUT_MATRICES:
149
+ @staticmethod
150
+ def draw_matrix(text1, text2, text3, matrixType="square"):
151
+ """
152
+ Draws matrices with three text parameters.
153
+ Available in 3 styles:
154
+ - Square
155
+ - Rounded
156
+ - Curly
157
+ """
158
+ # Combine inputs to find the maximum string length efficiently
159
+ texts = [text1, text2, text3]
160
+ biggestLength = max(len(t) for t in texts)
161
+
162
+ # Dynamically pad each text string to match the longest one
163
+ padded_texts = [t.ljust(biggestLength) for t in texts]
164
+
165
+ if matrixType == "square":
166
+ # Brackets now dynamically scale based on the largest input width
167
+ topBracket = "⎡ " + padded_texts[0] + " ⎤"
168
+ middleBracket = "⎢ " + padded_texts[1] + " ⎥"
169
+ bottomBracket = "⎣ " + padded_texts[2] + " ⎦"
170
+ elif matrixType == "rounded":
171
+ topBracket = "⎧ " + padded_texts[0] + " ⎫"
172
+ middleBracket = "⎪ " + padded_texts[1] + " ⎪"
173
+ bottomBracket = "⎩ " + padded_texts[2] + " ⎭"
174
+ elif matrixType == "curly":
175
+ topBracket = "⎧ " + padded_texts[0] + " ⎫"
176
+ middleBracket = "⎨ " + padded_texts[1] + " ⎬"
177
+ bottomBracket = "⎩ " + padded_texts[2] + " ⎭"
178
+
179
+ return topBracket + "\n" + middleBracket + "\n" + bottomBracket + "\n"
180
+
181
+ class MATRICES:
182
+ @staticmethod
183
+ def draw_matrix(text, matrixType="square"):
184
+ """
185
+ Draws matrices with one text parameter.
186
+ Available in 3 styles:
187
+ - Square
188
+ - Rounded
189
+ - Curly
190
+ """
191
+ textLength = 0
192
+ textLength = len(text)
193
+ if matrixType == "square":
194
+ topBracket = "⎡" + ((" " * textLength) + " ") + "⎤"
195
+ middleBracket = "⎢" + (" " + text + " ") + "⎥"
196
+ bottomBracket = "⎣" + ((" " * textLength) + " ") + "⎦"
197
+ elif matrixType == "rounded":
198
+ topBracket = "⎧" + ((" " * textLength) + " ") + "⎫"
199
+ middleBracket = "⎪" + (" " + text + " ") + "⎪"
200
+ bottomBracket = "⎩" + ((" " * textLength) + " ") + "⎭"
201
+ elif matrixType == "curly":
202
+ topBracket = "⎧" + ((" " * textLength) + " ") + "⎫"
203
+ middleBracket = "⎨" + (" " + text + " ") + "⎬"
204
+ bottomBracket = "⎩" + ((" " * textLength) + " ") + "⎭"
205
+
206
+ return((topBracket + "\n") + (middleBracket + "\n") + (bottomBracket + "\n"))
207
+
208
+
209
+ class WRITEDOWN:
210
+ def format_writedown(writedown_text):
211
+ """
212
+ Parses standard Writedown (a Markdown modification) syntax string formatting loops and translates
213
+ them directly into terminal screen Colorama escape styles.
214
+ """
215
+ lines = writedown_text.split(r"\n") # Splits text lines accurately
216
+
217
+
218
+
219
+ for line in lines:
220
+ processed_line = line.strip()
221
+
222
+ # 1. Parse # Headers -> Bright Cyan Bold
223
+ if processed_line.startswith("# "):
224
+ processed_line = "\033[36m" + "\033[1m" + "▶ " + processed_line[2:].upper()
225
+ # 2. Parse ## and ### Headers -> Bright White Bold
226
+ elif processed_line.startswith("## "):
227
+ processed_line = "\033[36m" + "\033[1m" + "▷ " + processed_line[3:]
228
+ elif processed_line.startswith("### "):
229
+ processed_line = "\033[37m" + "‣ " + processed_line[4:]
230
+ # 3. Parse * Bullet points -> Green Bullet Indent
231
+ elif processed_line.startswith("* "):
232
+ processed_line = " " + "\033[32m" + "• " + "\033[37m" + processed_line[2:]
233
+ elif processed_line.startswith("- "):
234
+ processed_line = " " + "\033[32m" + "- " + "\033[37m" + processed_line[2:]
235
+ elif processed_line.startswith("> "):
236
+ processed_line = " " + "\033[33m" + "‣ " + "\033[37m" + processed_line[2:]
237
+ elif processed_line.startswith("1. "):
238
+ processed_line = " " + "\033[31m" + "1. " + "\033[37m" + processed_line[3:]
239
+ elif processed_line.startswith("2. "):
240
+ processed_line = " " + "\033[31m" + "2. " + "\033[37m" + processed_line[3:]
241
+ elif processed_line.startswith("3. "):
242
+ processed_line = " " + "\033[31m" + "3. " + "\033[37m" + processed_line[3:]
243
+ elif processed_line.startswith("4. "):
244
+ processed_line = " " + "\033[31m" + "4. " + "\033[37m" + processed_line[3:]
245
+ elif processed_line.startswith("5. "):
246
+ processed_line = " " + "\033[31m" + "5. " + "\033[37m" + processed_line[3:]
247
+ elif processed_line.startswith("6. "):
248
+ processed_line = " " + "\033[31m" + "6. " + "\033[37m" + processed_line[3:]
249
+ elif processed_line.startswith("7. "):
250
+ processed_line = " " + "\033[31m" + "7. " + "\033[37m" + processed_line[3:]
251
+ elif processed_line.startswith("8. "):
252
+ processed_line = " " + "\033[31m" + "8. " + "\033[37m" + processed_line[3:]
253
+ elif processed_line.startswith("9. "):
254
+ processed_line = " " + "\033[31m" + "9. " + "\033[37m" + processed_line[3:]
255
+ elif processed_line.startswith("10. "):
256
+ processed_line = " " + "\033[31m" + "10. " + "\033[37m" + processed_line[4:]
257
+
258
+ # 4. Parse Inline **Bold** markers using colorama replacements
259
+ while "**" in processed_line:
260
+ processed_line = processed_line.replace("**", "\033[33m" + "\033[1m", 1).replace("**", "\033[0m" + "\033[37m", 1)
261
+
262
+ # 5. Parse Inline *Italic* markers (we can use Underline style for italics in terminal layouts)
263
+ while "*" in processed_line:
264
+ processed_line = processed_line.replace("*", "\033[4m", 1).replace("*", "\033[24m", 1)
265
+
266
+ # 6. Parse Inline `Code` markers -> Magenta text style
267
+ while "`" in processed_line:
268
+ processed_line = processed_line.replace("`", "\033[35m", 1).replace("`", "\033[37m", 1)
269
+
270
+ while "=Y=" in processed_line:
271
+ processed_line = processed_line.replace("=Y=", "\033[43m", 1).replace("=Y=", "\033[0m", 1)
272
+
273
+ while "=R=" in processed_line:
274
+ processed_line = processed_line.replace("=R=", "\033[41m", 1).replace("=R=", "\033[0m", 1)
275
+
276
+ while "=G=" in processed_line:
277
+ processed_line = processed_line.replace("=G=", "\033[42m", 1).replace("=G=", "\033[0m", 1)
278
+
279
+ while "=C=" in processed_line:
280
+ processed_line = processed_line.replace("=C=", "\033[46m", 1).replace("=C=", "\033[0m", 1)
281
+
282
+ while "=B=" in processed_line:
283
+ processed_line = processed_line.replace("=B=", "\033[44m", 1).replace("=B=", "\033[0m", 1)
284
+
285
+ return("\033[0m" + processed_line + "\033[0m")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: loopstring
3
- Version: 0.0.5
3
+ Version: 0.2.0
4
4
  Summary: Terminal utilities
5
5
  Requires-Python: >=3.7
6
6
  Description-Content-Type: text/markdown
@@ -0,0 +1,6 @@
1
+ loopstring/__init__.py,sha256=JwlaxgSNMrKB5FLZZf9R3p38hHjeJ8JlqhZmrYUHmeA,109
2
+ loopstring/loopstring.py,sha256=Jd2Zsxy5NVEr7os-dlsNDqVh28zWjk_5ZSIfFTRNdQQ,12122
3
+ loopstring-0.2.0.dist-info/METADATA,sha256=d-NbHV_1eD9t8zLCu-X1ot3na8O23LkDiVwYOdfsJ9g,1493
4
+ loopstring-0.2.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
5
+ loopstring-0.2.0.dist-info/top_level.txt,sha256=2ydcZBVjxIoTy9e7zFiQFH3LMMAGVBh6iPbdCfKdtqo,11
6
+ loopstring-0.2.0.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- loopstring/__init__.py,sha256=JwlaxgSNMrKB5FLZZf9R3p38hHjeJ8JlqhZmrYUHmeA,109
2
- loopstring/loopstring.py,sha256=SzWK5lGPTcMISBip-y-LvCeQ4c4_zzk7qBKf5Y8LHEY,3156
3
- loopstring-0.0.5.dist-info/METADATA,sha256=5GJ-EQ70aE0xIc6K9MdtiQ0EB_ZTry7pprvLPnI1udA,1493
4
- loopstring-0.0.5.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
5
- loopstring-0.0.5.dist-info/top_level.txt,sha256=2ydcZBVjxIoTy9e7zFiQFH3LMMAGVBh6iPbdCfKdtqo,11
6
- loopstring-0.0.5.dist-info/RECORD,,