my-banner-cli 0.1.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,9 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: my_banner_cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A terminal utility to print awesome stylized ASCII art banners
|
|
5
|
+
Requires-Python: >=3.7
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: License
|
|
8
|
+
Requires-Dist: rich>=13.0.0
|
|
9
|
+
Dynamic: license-file
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
my_banner_cli-0.1.0.dist-info/licenses/License,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
my_package/__init__.py,sha256=RR3JWLYzObRDlA6LxsHdPP-aYbwczirLIfUAENX_6xk,35
|
|
3
|
+
my_package/module.py,sha256=7ALpxOlrfbi7YwSEKIbB1-bk43-25mj4Dvf0HuODKoQ,2265
|
|
4
|
+
my_banner_cli-0.1.0.dist-info/METADATA,sha256=jzSJnEA4KHoz1OANqFWHy6mT5y4DtVMwKF9ooa6lPlw,273
|
|
5
|
+
my_banner_cli-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
6
|
+
my_banner_cli-0.1.0.dist-info/top_level.txt,sha256=4OyEe7aVmevjXrMpt_mY6srrUUjZGHyUPvlu5sUpLn4,11
|
|
7
|
+
my_banner_cli-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
my_package
|
my_package/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .module import generate_banner
|
my_package/module.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from rich.console import Console
|
|
2
|
+
from rich.panel import Panel
|
|
3
|
+
|
|
4
|
+
console = Console()
|
|
5
|
+
|
|
6
|
+
# A miniature, custom dictionary grid for block letters (A-Z)
|
|
7
|
+
BLOCK_LETTERS = {
|
|
8
|
+
'A': [" ■■■ ", " ■ ■ ", " ■■■■■ ", " ■ ■ ", " ■ ■ "],
|
|
9
|
+
'B': [" ■■■■ ", " ■ ■ ", " ■■■■ ", " ■ ■ ", " ■■■■ "],
|
|
10
|
+
'C': [" ■■■■ ", " ■ ", " ■ ", " ■ ", " ■■■■ "],
|
|
11
|
+
'H': [" ■ ■ ", " ■ ■ ", " ■■■■■ ", " ■ ■ ", " ■ ■ "],
|
|
12
|
+
'E': [" ■■■■■ ", " ■ ", " ■■■ ", " ■ ", " ■■■■■ "],
|
|
13
|
+
'L': [" ■ ", " ■ ", " ■ ", " ■ ", " ■■■■■ "],
|
|
14
|
+
'O': [" ■■■ ", " ■ ■ ", " ■ ■ ", " ■ ■ ", " ■■■ "],
|
|
15
|
+
'P': [" ■■■■ ", " ■ ■ ", " ■■■■ ", " ■ ", " ■ "],
|
|
16
|
+
'R': [" ■■■■ ", " ■ ■ ", " ■■■■ ", " ■ ■ ", " ■ ■ "],
|
|
17
|
+
'S': [" ■■■■ ", " ■ ", " ■■■ ", " ■ ", " ■■■■ "],
|
|
18
|
+
'T': [" ■■■■■ ", " ■ ", " ■ ", " ■ ", " ■ "],
|
|
19
|
+
'Y': [" ■ ■ ", " ■ ■ ", " ■ ", " ■ ", " ■ "],
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def generate_banner(text: str, color: str = "cyan", style: str = "bold"):
|
|
24
|
+
"""Generates a large ASCII block banner wrapped inside a styled terminal panel."""
|
|
25
|
+
clean_text = text.upper().strip()
|
|
26
|
+
|
|
27
|
+
# Initialize 5 empty rows for the height of our block font
|
|
28
|
+
lines = ["", "", "", "", ""]
|
|
29
|
+
|
|
30
|
+
# Construct the characters line by line side-by-side
|
|
31
|
+
for char in clean_text:
|
|
32
|
+
if char in BLOCK_LETTERS:
|
|
33
|
+
for i in range(5):
|
|
34
|
+
lines[i] += BLOCK_LETTERS[char] + " "
|
|
35
|
+
else:
|
|
36
|
+
# Handle spaces or unsupported characters smoothly
|
|
37
|
+
for i in range(5):
|
|
38
|
+
lines[i] += " "
|
|
39
|
+
|
|
40
|
+
banner_content = "\n".join(lines)
|
|
41
|
+
|
|
42
|
+
# Wrap it inside a beautiful Rich panel
|
|
43
|
+
panel = Panel(
|
|
44
|
+
banner_content,
|
|
45
|
+
title="[reverse] BANNER GENERATOR [/reverse]",
|
|
46
|
+
subtitle=f"Style: {style} | Color: {color}",
|
|
47
|
+
style=f"{style} {color}",
|
|
48
|
+
expand=False
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
console.print(panel)
|