loopstring 0.0.1__tar.gz

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,48 @@
1
+ Metadata-Version: 2.4
2
+ Name: loopstring
3
+ Version: 0.0.1
4
+ Summary: A terminal string layout, coloring, and box-drawing utility.
5
+ Requires-Python: >=3.7
6
+ Description-Content-Type: text/markdown
7
+
8
+ # LoopString
9
+
10
+ A lightweight, powerful Python utility for terminal text formatting, custom box-drawing, and terminal UI layouts.
11
+
12
+ ## Features
13
+
14
+ - **Custom Box UI:** Wrap single or multi-line text blocks in `light`, `heavy`, `double`, `rounded`, or `dashed` geometric borders.
15
+ - **Clean Namespaces:** Organized using clean object structures (`FG`, `BG`, `FORMAT`, `BOXES`) to ensure autocomplete works perfectly in your IDE.
16
+ - **Styling Combinations:** Easily concatenate colors and text styles without syntax errors or formatting collisions.
17
+ - **Pre-built Symbols:** Enjoy stress-free symbol concatenation without having to copy-paste.
18
+
19
+ ## Installation
20
+
21
+ Once published, you can install the package directly from PyPI using pip:
22
+
23
+ ```bash
24
+ pip install loopstring
25
+ ```
26
+
27
+ ## Usage Examples
28
+
29
+ ### 1. Drawing a Custom Box
30
+ ```python
31
+ from loopstring import BOXES
32
+
33
+ # Draw a clean rounded box around your text
34
+ print(BOXES.rounded("System Online"))
35
+ ```
36
+
37
+ ### 2. Styling Terminal Text
38
+ ```python
39
+ from loopstring import FG, BG, FORMAT
40
+
41
+ # Apply vibrant styles safely without tuples
42
+ print(f"{FG.GREEN}{FORMAT.BOLD}Success!{FORMAT.RESET} Everything loaded correctly.")
43
+ print(f"{BG.BLUE}{FG.WHITE} Notice {FORMAT.RESET} Check system updates.")
44
+ ```
45
+
46
+ ## License
47
+
48
+ This project is licensed under the MIT License - see the LICENSE file for details.
@@ -0,0 +1,41 @@
1
+ # LoopString
2
+
3
+ A lightweight, powerful Python utility for terminal text formatting, custom box-drawing, and terminal UI layouts.
4
+
5
+ ## Features
6
+
7
+ - **Custom Box UI:** Wrap single or multi-line text blocks in `light`, `heavy`, `double`, `rounded`, or `dashed` geometric borders.
8
+ - **Clean Namespaces:** Organized using clean object structures (`FG`, `BG`, `FORMAT`, `BOXES`) to ensure autocomplete works perfectly in your IDE.
9
+ - **Styling Combinations:** Easily concatenate colors and text styles without syntax errors or formatting collisions.
10
+ - **Pre-built Symbols:** Enjoy stress-free symbol concatenation without having to copy-paste.
11
+
12
+ ## Installation
13
+
14
+ Once published, you can install the package directly from PyPI using pip:
15
+
16
+ ```bash
17
+ pip install loopstring
18
+ ```
19
+
20
+ ## Usage Examples
21
+
22
+ ### 1. Drawing a Custom Box
23
+ ```python
24
+ from loopstring import BOXES
25
+
26
+ # Draw a clean rounded box around your text
27
+ print(BOXES.rounded("System Online"))
28
+ ```
29
+
30
+ ### 2. Styling Terminal Text
31
+ ```python
32
+ from loopstring import FG, BG, FORMAT
33
+
34
+ # Apply vibrant styles safely without tuples
35
+ print(f"{FG.GREEN}{FORMAT.BOLD}Success!{FORMAT.RESET} Everything loaded correctly.")
36
+ print(f"{BG.BLUE}{FG.WHITE} Notice {FORMAT.RESET} Check system updates.")
37
+ ```
38
+
39
+ ## License
40
+
41
+ This project is licensed under the MIT License - see the LICENSE file for details.
File without changes
@@ -0,0 +1,93 @@
1
+ class FG:
2
+ """Foreground text colors"""
3
+ BLACK = "\033[30m"
4
+ RED = "\033[31m"
5
+ GREEN = "\033[32m"
6
+ YELLOW = "\033[33m"
7
+ BLUE = "\033[34m"
8
+ MAGENTA = "\033[35m"
9
+ CYAN = "\033[36m"
10
+ WHITE = "\033[37m"
11
+ RESET = "\033[39m"
12
+
13
+ class BG:
14
+ """Background colors"""
15
+ BLACK = "\033[40m"
16
+ RED = "\033[41m"
17
+ GREEN = "\033[42m"
18
+ YELLOW = "\033[43m"
19
+ BLUE = "\033[44m"
20
+ MAGENTA = "\033[45m"
21
+ CYAN = "\033[46m"
22
+ WHITE = "\033[47m"
23
+ RESET = "\033[49m"
24
+
25
+ class FORMAT:
26
+ """Formatting tags"""
27
+ BOLD = '\033[1m' # Bold
28
+ DIM = '\033[2m' # Dim
29
+ ITALIC = '\033[3m' # Italic
30
+ UNDERLINE = '\033[4m' # Underline
31
+ REVERSE = '\033[7m' # Reverse video
32
+ STRIKETHROUGH = '\033[9m' # Strikethrough
33
+
34
+ class BOXES:
35
+ @staticmethod
36
+ def draw_box(text: str, style: str = 'light') -> str:
37
+ """Wraps text inside a customizable Unicode box.
38
+
39
+ Supported styles: 'light', 'heavy', 'double', 'rounded', 'dashed'
40
+ """
41
+ # Define unicode box-drawing character maps
42
+ glyphs = {
43
+ 'light': {'h': '─', 'v': '│', 'tl': '┌', 'tr': '┐', 'bl': '└', 'br': '┘'},
44
+ 'heavy': {'h': '━', 'v': '┃', 'tl': '┏', 'tr': '┓', 'bl': '┗', 'br': '┛'},
45
+ 'double': {'h': '═', 'v': '║', 'tl': '╔', 'tr': '╗', 'bl': '╚', 'br': '╝'},
46
+ 'rounded': {'h': '─', 'v': '│', 'tl': '╭', 'tr': '╮', 'bl': '╰', 'br': '╯'},
47
+ # Using a triple-dash pattern for the dashed style
48
+ 'dashed': {'h': '┄', 'v': '┆', 'tl': '┌', 'tr': '┐', 'bl': '└', 'br': '┘'}
49
+ }
50
+
51
+ # Fallback to light style if an invalid style is passed
52
+ g = glyphs.get(style.lower(), glyphs['light'])
53
+
54
+ # Split text into lines and find the longest line to set box width
55
+ lines = text.split('\n')
56
+ max_width = max(len(line) for line in lines) if lines else 0
57
+
58
+ # Construct the box layers
59
+ box = []
60
+ box.append(f"{g['tl']}{g['h'] * (max_width + 2)}{g['tr']}")
61
+
62
+ for line in lines:
63
+ box.append(f"{g['v']} {line.ljust(max_width)} {g['v']}")
64
+
65
+ box.append(f"{g['bl']}{g['h'] * (max_width + 2)}{g['br']}")
66
+
67
+ return '\n'.join(box)
68
+
69
+ class SYMBOLS:
70
+ """Cool symbols!"""
71
+ HEXAGON = '⬢' # Bold
72
+ PENTAGON = '⬟' # Dim
73
+ STAR = '⭑' # Italic
74
+ DOWNLOAD = '⤓' # Underline
75
+ REVERSE = '\033[7m' # Reverse video
76
+ STRIKETHROUGH = '\033[9m' # Strikethrough
77
+ LIGHTSHADE = '░'
78
+ MEDIUMSHADE = '▒'
79
+ DARKSHADE = '▓'
80
+ FULLSHADE = '█'
81
+ PHONE = '☎'
82
+ PENTAGONARROW = '⭔'
83
+ ENTERKEY = '⏎'
84
+ CHECKMARK = '✓'
85
+ SPACEBAR = '␣'
86
+ THINSQUARE = '⌷'
87
+ SLOPE = '⌳'
88
+ FILLEDRIGHTTRIANGLE = '▶'
89
+ RIGHTTRIANGLE = '▷'
90
+ ASTROIDSTAR = '✦'
91
+
92
+ print(BOXES.draw_box("lol", "heavy"))
93
+ print(FORMAT.BOLD + "text")
@@ -0,0 +1,48 @@
1
+ Metadata-Version: 2.4
2
+ Name: loopstring
3
+ Version: 0.0.1
4
+ Summary: A terminal string layout, coloring, and box-drawing utility.
5
+ Requires-Python: >=3.7
6
+ Description-Content-Type: text/markdown
7
+
8
+ # LoopString
9
+
10
+ A lightweight, powerful Python utility for terminal text formatting, custom box-drawing, and terminal UI layouts.
11
+
12
+ ## Features
13
+
14
+ - **Custom Box UI:** Wrap single or multi-line text blocks in `light`, `heavy`, `double`, `rounded`, or `dashed` geometric borders.
15
+ - **Clean Namespaces:** Organized using clean object structures (`FG`, `BG`, `FORMAT`, `BOXES`) to ensure autocomplete works perfectly in your IDE.
16
+ - **Styling Combinations:** Easily concatenate colors and text styles without syntax errors or formatting collisions.
17
+ - **Pre-built Symbols:** Enjoy stress-free symbol concatenation without having to copy-paste.
18
+
19
+ ## Installation
20
+
21
+ Once published, you can install the package directly from PyPI using pip:
22
+
23
+ ```bash
24
+ pip install loopstring
25
+ ```
26
+
27
+ ## Usage Examples
28
+
29
+ ### 1. Drawing a Custom Box
30
+ ```python
31
+ from loopstring import BOXES
32
+
33
+ # Draw a clean rounded box around your text
34
+ print(BOXES.rounded("System Online"))
35
+ ```
36
+
37
+ ### 2. Styling Terminal Text
38
+ ```python
39
+ from loopstring import FG, BG, FORMAT
40
+
41
+ # Apply vibrant styles safely without tuples
42
+ print(f"{FG.GREEN}{FORMAT.BOLD}Success!{FORMAT.RESET} Everything loaded correctly.")
43
+ print(f"{BG.BLUE}{FG.WHITE} Notice {FORMAT.RESET} Check system updates.")
44
+ ```
45
+
46
+ ## License
47
+
48
+ This project is licensed under the MIT License - see the LICENSE file for details.
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ loopstring/__init__.py
5
+ loopstring/loopstring.py
6
+ loopstring.egg-info/PKG-INFO
7
+ loopstring.egg-info/SOURCES.txt
8
+ loopstring.egg-info/dependency_links.txt
9
+ loopstring.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ loopstring
@@ -0,0 +1,10 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "loopstring"
7
+ version = "0.0.1"
8
+ description = "A terminal string layout, coloring, and box-drawing utility."
9
+ readme = "README.md"
10
+ requires-python = ">=3.7"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ from setuptools import setup
2
+
3
+ # This tells setuptools to dynamically read everything from your pyproject.toml
4
+ setup()