bear-utils 0.8.26__py3-none-any.whl → 0.9.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.
@@ -0,0 +1,463 @@
1
+ # ruff: noqa: E741
2
+ # fmt: off
3
+ A = [
4
+ " █████ ",
5
+ "██ ██ ",
6
+ "███████ ",
7
+ "██ ██ ",
8
+ "██ ██ "
9
+ ]
10
+
11
+ B = [
12
+ "██████ ",
13
+ "██ ██ ",
14
+ "██████ ",
15
+ "██ ██ ",
16
+ "██████ "
17
+ ]
18
+
19
+ C = [
20
+ " ██████ ",
21
+ "██ ",
22
+ "██ ",
23
+ "██ ",
24
+ " ██████ "
25
+ ]
26
+
27
+ D = [
28
+ "██████ ",
29
+ "██ ██ ",
30
+ "██ ██ ",
31
+ "██ ██ ",
32
+ "██████ "
33
+ ]
34
+
35
+ E = [
36
+ "███████ ",
37
+ "██ ",
38
+ "█████ ",
39
+ "██ ",
40
+ "███████ "
41
+ ]
42
+
43
+ F = [
44
+ "███████ ",
45
+ "██ ",
46
+ "█████ ",
47
+ "██ ",
48
+ "██ "
49
+ ]
50
+
51
+ G = [
52
+ " ██████ ",
53
+ "██ ",
54
+ "██ ███ ",
55
+ "██ ██ ",
56
+ " ██████ "
57
+ ]
58
+
59
+ H = [
60
+ "██ ██ ",
61
+ "██ ██ ",
62
+ "███████ ",
63
+ "██ ██ ",
64
+ "██ ██ "
65
+ ]
66
+
67
+ I = [
68
+ "███████ ",
69
+ " ██ ",
70
+ " ██ ",
71
+ " ██ ",
72
+ "███████ "
73
+ ]
74
+
75
+ J = [
76
+ "███████ ",
77
+ " ██ ",
78
+ " ██ ",
79
+ "██ ██ ",
80
+ " ██████ "
81
+ ]
82
+
83
+ K = [
84
+ "██ ██ ",
85
+ "██ ██ ",
86
+ "█████ ",
87
+ "██ ██ ",
88
+ "██ ██ "
89
+ ]
90
+
91
+ L = [
92
+ "██ ",
93
+ "██ ",
94
+ "██ ",
95
+ "██ ",
96
+ "███████ "
97
+ ]
98
+
99
+ M = [
100
+ "██ ██ ",
101
+ "███ ███ ",
102
+ "██ █ ██ ",
103
+ "██ ██ ",
104
+ "██ ██ "
105
+ ]
106
+
107
+ N = [
108
+ "██ ██ ",
109
+ "███ ██ ",
110
+ "██ █ ██ ",
111
+ "██ ███ ",
112
+ "██ ██ "
113
+ ]
114
+
115
+ O = [
116
+ " ██████ ",
117
+ "██ ██",
118
+ "██ ██",
119
+ "██ ██",
120
+ " ██████ "
121
+ ]
122
+
123
+ P = [
124
+ "██████ ",
125
+ "██ ██ ",
126
+ "██████ ",
127
+ "██ ",
128
+ "██ "
129
+ ]
130
+
131
+ Q = [
132
+ " ██████ ",
133
+ "██ ██",
134
+ "██ █ ██",
135
+ "██ ██ ",
136
+ " ██████ "
137
+ ]
138
+
139
+ R = [
140
+ "██████ ",
141
+ "██ ██ ",
142
+ "██████ ",
143
+ "██ ██ ",
144
+ "██ ██ "
145
+ ]
146
+
147
+ S = [
148
+ " ██████ ",
149
+ "██ ",
150
+ " ██████ ",
151
+ " ██",
152
+ " ██████ "
153
+ ]
154
+
155
+ T = [
156
+ "███████ ",
157
+ " ██ ",
158
+ " ██ ",
159
+ " ██ ",
160
+ " ██ "
161
+ ]
162
+
163
+ U = [
164
+ "██ ██ ",
165
+ "██ ██ ",
166
+ "██ ██ ",
167
+ "██ ██ ",
168
+ " ██████ "
169
+ ]
170
+
171
+ V = [
172
+ "██ ██ ",
173
+ "██ ██ ",
174
+ "██ ██ ",
175
+ " █ █ █ ",
176
+ " █ █ "
177
+ ]
178
+
179
+ W = [
180
+ "██ ██ ",
181
+ "██ ██ ",
182
+ "██ █ ██ ",
183
+ "███████ ",
184
+ "██ ██ "
185
+ ]
186
+
187
+ X = [
188
+ "██ ██ ",
189
+ " █ █ █ ",
190
+ " █ █ ",
191
+ " █ █ █ ",
192
+ "██ ██ "
193
+ ]
194
+
195
+ Y = [
196
+ "██ ██ ",
197
+ " █ █ █ ",
198
+ " █ █ ",
199
+ " ██ ",
200
+ " ██ "
201
+ ]
202
+
203
+ Z = [
204
+ "███████ ",
205
+ " ██ ",
206
+ " ██ ",
207
+ " ██ ",
208
+ "███████ "
209
+ ]
210
+
211
+ ZERO = [
212
+ " ██████ ",
213
+ "██ ██",
214
+ "██ █ ██",
215
+ "██ ██ ",
216
+ " ██████ "
217
+ ]
218
+
219
+ ONE = [
220
+ " ██ ",
221
+ " ███ ",
222
+ " ██ ",
223
+ " ██ ",
224
+ "███████ "
225
+ ]
226
+
227
+ TWO = [
228
+ " ██████ ",
229
+ "██ ██",
230
+ " ██ ",
231
+ " ██ ",
232
+ "███████ "
233
+ ]
234
+
235
+ THREE = [
236
+ " ██████ ",
237
+ "██ ██",
238
+ " ██ ",
239
+ "██ ██",
240
+ " ██████ "
241
+ ]
242
+
243
+ FOUR = [
244
+ "██ ██ ",
245
+ "██ ██ ",
246
+ "███████ ",
247
+ " ██ ",
248
+ " ██ "
249
+ ]
250
+
251
+ FIVE = [
252
+ "███████ ",
253
+ "██ ",
254
+ "██████ ",
255
+ " ██ ",
256
+ " ██████ "
257
+ ]
258
+
259
+ SIX = [
260
+ " ██████ ",
261
+ "██ ",
262
+ "██████ ",
263
+ "██ ██",
264
+ " ██████ "
265
+ ]
266
+
267
+ SEVEN = [
268
+ "███████ ",
269
+ " ██ ",
270
+ " ██ ",
271
+ " ██ ",
272
+ " ██ "
273
+ ]
274
+
275
+ EIGHT = [
276
+ " ██████ ",
277
+ "██ ██",
278
+ " ██████ ",
279
+ "██ ██",
280
+ " ██████ "
281
+ ]
282
+
283
+ NINE = [
284
+ " ██████ ",
285
+ "██ ██",
286
+ " ██████ ",
287
+ " ██ ",
288
+ " ██████ "
289
+ ]
290
+
291
+ SPACE = [
292
+ " ",
293
+ " ",
294
+ " ",
295
+ " ",
296
+ " "
297
+ ]
298
+
299
+ EXCLAMATION = [
300
+ " ██ ",
301
+ " ██ ",
302
+ " ██ ",
303
+ " ",
304
+ " ██ "
305
+ ]
306
+
307
+ QUESTION = [
308
+ " ██████ ",
309
+ "██ ██",
310
+ " ██ ",
311
+ " ██ ",
312
+ " ██ "
313
+ ]
314
+
315
+ DOT = [
316
+ " ",
317
+ " ",
318
+ " ██ ",
319
+ " ██ ",
320
+ " ██ "
321
+ ]
322
+
323
+ COMMA = [
324
+ " ",
325
+ " ",
326
+ " ██ ",
327
+ " ██ ",
328
+ " ██ "
329
+ ]
330
+
331
+ DASH = [
332
+ " ",
333
+ " ",
334
+ "███████ ",
335
+ " ",
336
+ " "
337
+ ]
338
+
339
+ UNDERSCORE = [
340
+ " ",
341
+ " ",
342
+ " ",
343
+ " ",
344
+ "███████ "
345
+ ]
346
+
347
+ EQUALS = [
348
+ " ",
349
+ "███████ ",
350
+ " ",
351
+ "███████ ",
352
+ " "
353
+ ]
354
+
355
+ PLUS = [
356
+ " ",
357
+ " ██ ",
358
+ "███████ ",
359
+ " ██ ",
360
+ " "
361
+ ]
362
+
363
+ ASTERISK = [
364
+ " ██ ",
365
+ " ██████ ",
366
+ "████████",
367
+ " ██████ ",
368
+ " ██ "
369
+ ]
370
+
371
+ FORWARD_SLASH = [
372
+ " ██ ",
373
+ " ██ ",
374
+ " ██ ",
375
+ " ██ ",
376
+ " ██ "
377
+ ]
378
+
379
+ BACKWARD_SLASH = [
380
+ " ██ ",
381
+ " ██ ",
382
+ " ██ ",
383
+ " ██ ",
384
+ " ██ "
385
+ ]
386
+
387
+ AT = [
388
+ " ██████ ",
389
+ "██ ██",
390
+ "██ ███ ██",
391
+ "██ ██ ",
392
+ " ██████ "
393
+ ]
394
+
395
+ HASH = [
396
+ " ██ ",
397
+ "███████ ",
398
+ " ██ ",
399
+ "███████ ",
400
+ " ██ "
401
+ ]
402
+
403
+ DOLLAR = [
404
+ " ██████ ",
405
+ " ██ ██",
406
+ " ██ ███ ██",
407
+ " ██ ██ ",
408
+ " ██████ "
409
+ ]
410
+
411
+ __all__ = [
412
+ "ASTERISK",
413
+ "AT",
414
+ "BACKWARD_SLASH",
415
+ "COMMA",
416
+ "DASH",
417
+ "DOLLAR",
418
+ "DOT",
419
+ "EIGHT",
420
+ "EQUALS",
421
+ "EXCLAMATION",
422
+ "FIVE",
423
+ "FORWARD_SLASH",
424
+ "FOUR",
425
+ "HASH",
426
+ "NINE",
427
+ "ONE",
428
+ "PLUS",
429
+ "QUESTION",
430
+ "SEVEN",
431
+ "SIX",
432
+ "SPACE",
433
+ "THREE",
434
+ "TWO",
435
+ "UNDERSCORE",
436
+ "ZERO",
437
+ "A",
438
+ "B",
439
+ "C",
440
+ "D",
441
+ "E",
442
+ "F",
443
+ "G",
444
+ "H",
445
+ "I",
446
+ "J",
447
+ "K",
448
+ "L",
449
+ "M",
450
+ "N",
451
+ "O",
452
+ "P",
453
+ "Q",
454
+ "R",
455
+ "S",
456
+ "T",
457
+ "U",
458
+ "V",
459
+ "W",
460
+ "X",
461
+ "Y",
462
+ "Z",
463
+ ]
@@ -0,0 +1,11 @@
1
+ class CyberTheme:
2
+ """Namespace for cyberpunk color theme constants."""
3
+
4
+ primary: str = "bright_magenta"
5
+ neon_green: str = "bright_green"
6
+ neon_cyan: str = "bright_cyan"
7
+ warning: str = "bright_yellow"
8
+ error: str = "bright_red"
9
+ credits: str = "bright_yellow"
10
+ data: str = "bright_blue"
11
+ system: str = "dim white"
@@ -0,0 +1,150 @@
1
+ """A dictionary containing ASCII art representations of letters and symbols in a block font style."""
2
+
3
+ from rich.align import Align
4
+ from rich.console import Console
5
+
6
+ from bear_utils.graphics.font._theme import CyberTheme as Theme
7
+
8
+ from ._raw_block_letters import (
9
+ ASTERISK,
10
+ AT,
11
+ BACKWARD_SLASH,
12
+ COMMA,
13
+ DASH,
14
+ DOLLAR,
15
+ DOT,
16
+ EIGHT,
17
+ EQUALS,
18
+ EXCLAMATION,
19
+ FIVE,
20
+ FORWARD_SLASH,
21
+ FOUR,
22
+ HASH,
23
+ NINE,
24
+ ONE,
25
+ PLUS,
26
+ QUESTION,
27
+ SEVEN,
28
+ SIX,
29
+ SPACE,
30
+ THREE,
31
+ TWO,
32
+ UNDERSCORE,
33
+ ZERO,
34
+ A,
35
+ B,
36
+ C,
37
+ D,
38
+ E,
39
+ F,
40
+ G,
41
+ H,
42
+ I,
43
+ J,
44
+ K,
45
+ L,
46
+ M,
47
+ N,
48
+ O,
49
+ P,
50
+ Q,
51
+ R,
52
+ S,
53
+ T,
54
+ U,
55
+ V,
56
+ W,
57
+ X,
58
+ Y,
59
+ Z,
60
+ )
61
+
62
+ BLOCK_LETTERS: dict[str, list[str]] = {
63
+ "A": A,
64
+ "B": B,
65
+ "C": C,
66
+ "D": D,
67
+ "E": E,
68
+ "F": F,
69
+ "G": G,
70
+ "H": H,
71
+ "I": I,
72
+ "J": J,
73
+ "K": K,
74
+ "L": L,
75
+ "M": M,
76
+ "N": N,
77
+ "O": O,
78
+ "P": P,
79
+ "Q": Q,
80
+ "R": R,
81
+ "S": S,
82
+ "T": T,
83
+ "U": U,
84
+ "V": V,
85
+ "W": W,
86
+ "X": X,
87
+ "Y": Y,
88
+ "Z": Z,
89
+ "0": ZERO,
90
+ "1": ONE,
91
+ "2": TWO,
92
+ "3": THREE,
93
+ "4": FOUR,
94
+ "5": FIVE,
95
+ "6": SIX,
96
+ "7": SEVEN,
97
+ "8": EIGHT,
98
+ "9": NINE,
99
+ " ": SPACE,
100
+ "!": EXCLAMATION,
101
+ "?": QUESTION,
102
+ ".": DOT,
103
+ ",": COMMA,
104
+ "-": DASH,
105
+ "_": UNDERSCORE,
106
+ "=": EQUALS,
107
+ "+": PLUS,
108
+ "*": ASTERISK,
109
+ "/": FORWARD_SLASH,
110
+ "\\": BACKWARD_SLASH,
111
+ "@": AT,
112
+ "#": HASH,
113
+ "$": DOLLAR,
114
+ }
115
+
116
+ console = Console()
117
+
118
+
119
+ def char_to_block(char: str) -> list[str]:
120
+ """Convert a single character to its block font representation."""
121
+ return BLOCK_LETTERS.get(char.upper(), [" "] * 5)
122
+
123
+
124
+ def word_to_block(word: str) -> list[str]:
125
+ """Convert a word to its block font representation."""
126
+ clean_text: str = "".join(char for char in word.upper() if char in BLOCK_LETTERS)
127
+
128
+ if not clean_text:
129
+ return ["No valid characters to block-ify! 🧱"]
130
+
131
+ rows = ["", "", "", "", ""]
132
+ for char in clean_text:
133
+ block_char = char_to_block(char)
134
+ for i in range(5):
135
+ rows[i] += block_char[i]
136
+ return rows
137
+
138
+
139
+ def print_block_font(text: str, color: str = Theme.neon_green) -> None:
140
+ """Print block font text with cyberpunk styling."""
141
+ block_rows = word_to_block(text)
142
+
143
+ console.print()
144
+ for row in block_rows:
145
+ console.print(Align.center(f"[{color}]{row}[/{color}]"))
146
+ console.print()
147
+
148
+
149
+ __all__ = ["BLOCK_LETTERS", "char_to_block", "word_to_block"]
150
+ # fmt: on
@@ -0,0 +1,63 @@
1
+ """Ascii art glitch font generator for cyberpunk vibes!"""
2
+
3
+ from io import StringIO
4
+ import random
5
+
6
+ GLITCH_CHARS: list[str] = ["█", "▓", "░", "▒", "■", "□", "▪", "▫"]
7
+
8
+
9
+ def dice_roll(chance: float) -> bool:
10
+ """Roll a dice with a given chance."""
11
+ return random.random() < chance # noqa: S311, we aren't doing crypto bro
12
+
13
+
14
+ def dice_roll_choice(choices: list[str], chance: float = 0.5) -> str:
15
+ """Roll a dice to choose from a list of choices with a given chance."""
16
+ if dice_roll(chance):
17
+ return random.choice(choices) # noqa: S311, we aren't doing crypto bro
18
+ return ""
19
+
20
+
21
+ def glitch_font_generator(text: str, glitch_intensity: float = 0.3) -> str:
22
+ """Generate beautifully corrupted glitch text with MIXED characters."""
23
+ output = StringIO()
24
+
25
+ for char in text.upper():
26
+ if char == " ":
27
+ output.write(" ")
28
+ continue
29
+
30
+ output.write(char)
31
+ symbol: str = dice_roll_choice(GLITCH_CHARS, glitch_intensity)
32
+ output.write(symbol)
33
+ symbol2: str = dice_roll_choice(GLITCH_CHARS, glitch_intensity * 0.4)
34
+ output.write(symbol2)
35
+
36
+ result: str = output.getvalue()
37
+ output.close()
38
+ return result
39
+
40
+
41
+ def multi_line_glitch(*lines: str, base_intensity: float = 0.3) -> str:
42
+ """Generate glitch effects for multiple lines with StringIO magic."""
43
+ output = StringIO()
44
+
45
+ for i, line in enumerate(lines):
46
+ intensity: float = base_intensity + (i * 0.1)
47
+ glitched_line: str = glitch_font_generator(line, intensity)
48
+ output.write(glitched_line)
49
+
50
+ if i < len(lines) - 1:
51
+ output.write("\n")
52
+
53
+ result = output.getvalue()
54
+ output.close()
55
+ return result
56
+
57
+
58
+ def cyberpunk_glitch_font(*text: str, style: str = "heavy") -> str:
59
+ """Different glitch styles for maximum chaos."""
60
+ styles = {"light": 0.2, "medium": 0.4, "heavy": 0.6, "corrupted": 0.8}
61
+
62
+ intensity: float = styles.get(style, 0.4)
63
+ return multi_line_glitch(*text, base_intensity=intensity)