StyleUpText 0.1.0__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.
- styleuptext-0.1.0/LICENSE +33 -0
- styleuptext-0.1.0/PKG-INFO +126 -0
- styleuptext-0.1.0/README.md +114 -0
- styleuptext-0.1.0/pyproject.toml +24 -0
- styleuptext-0.1.0/setup.cfg +4 -0
- styleuptext-0.1.0/src/StyleUpText/__init__.py +0 -0
- styleuptext-0.1.0/src/StyleUpText/color.py +75 -0
- styleuptext-0.1.0/src/StyleUpText/style.py +49 -0
- styleuptext-0.1.0/src/StyleUpText.egg-info/PKG-INFO +126 -0
- styleuptext-0.1.0/src/StyleUpText.egg-info/SOURCES.txt +12 -0
- styleuptext-0.1.0/src/StyleUpText.egg-info/dependency_links.txt +1 -0
- styleuptext-0.1.0/src/StyleUpText.egg-info/entry_points.txt +2 -0
- styleuptext-0.1.0/src/StyleUpText.egg-info/requires.txt +1 -0
- styleuptext-0.1.0/src/StyleUpText.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Aplexon StyleUpText Non-Commercial & Revocable License Agreement
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arin Singla (aplexon.com). All rights reserved.
|
|
4
|
+
|
|
5
|
+
1. PERMITTED USES (NON-COMMERCIAL)
|
|
6
|
+
The Licensor (Arin Singla) hereby grants you a personal, non-exclusive,
|
|
7
|
+
non-transferable, and revocable license to use, modify, and distribute
|
|
8
|
+
this software ("StyleUpText") solely for personal, educational, or
|
|
9
|
+
non-commercial open-source research purposes.
|
|
10
|
+
|
|
11
|
+
2. COMMERCIAL RESTRICTIONS
|
|
12
|
+
You may NOT use this software, or any software derived from it, for any
|
|
13
|
+
commercial purpose, commercial venture, or business operations without
|
|
14
|
+
obtaining a separate, written commercial license agreement from the
|
|
15
|
+
Licensor. "Commercial purpose" includes, but is not limited to, using
|
|
16
|
+
the software in internal business tools, customer-facing applications,
|
|
17
|
+
paid services, or inside any software that generates revenue.
|
|
18
|
+
|
|
19
|
+
3. REVOCATION OF LICENSE
|
|
20
|
+
The Licensor reserves the right, at their sole discretion, to terminate or
|
|
21
|
+
revoke this license and any permissions granted under it at any time, with
|
|
22
|
+
or without cause, and without prior notice. Upon revocation, you must
|
|
23
|
+
immediately cease all use, modification, and distribution of the software
|
|
24
|
+
and destroy all copies in your possession.
|
|
25
|
+
|
|
26
|
+
4. LIMITATION OF LIABILITY
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
IMPLIED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
|
29
|
+
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
30
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
|
31
|
+
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
32
|
+
|
|
33
|
+
For commercial licensing inquiries, please contact: contactarin@aplexon.com
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: StyleUpText
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The best method to style text. Better than Rich + colorama
|
|
5
|
+
Author-email: Arin Singla <contactarin@aplexon.com>
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: pyfiglet>=1.0.2
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# 🎨 StyleUpText
|
|
14
|
+
|
|
15
|
+
A high-performance, lightweight terminal text-styling engine that gives you pinpoint precision over your console typography.
|
|
16
|
+
|
|
17
|
+
**StyleUpText** bridges the gap between competing CLI packages: it lets you change terminal colors instantly using real **Hex codes** and **24-bit Truecolor RGB**, while utilizing lightweight **BBCode tags** exclusively for text formatting (bold, italic, etc.) without the parsing overhead of heavier frameworks. Brought to you by [Aplexon](https://aplexon.com).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🚀 Key Advantages
|
|
22
|
+
|
|
23
|
+
* **True Color Freedom:** Supports any Hex code (`#C42D76`) or RGB tuple directly. You are never restricted to primitive 8-color console palettes.
|
|
24
|
+
* **Decoupled Architecture:** Colors are handled dynamically via execution functions, while text styles use clean BBCode tags (`[b]`, `[i]`, `[u]`, `[s]`).
|
|
25
|
+
* **Zero-Dependency Color Layer:** The color engine uses raw ANSI streams, ensuring lightweight deployment with zero background parsing overhead.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🛠️ Installation
|
|
30
|
+
|
|
31
|
+
Install the package directly via pip:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install StyleUpText
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 💻 Usage Examples
|
|
40
|
+
|
|
41
|
+
### 1. Hex & RGB Color Control (`color.py`)
|
|
42
|
+
Import the color sub-module to print precise truecolor lines or lock your terminal brush to a specific palette.
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from StyleUpText import color
|
|
46
|
+
|
|
47
|
+
# Print a specific line instantly using a hex code
|
|
48
|
+
color.Print_Line_Color_HEX("#C42D76", "This text is raspberry pink!")
|
|
49
|
+
|
|
50
|
+
# Lock the foreground color using RGB, print text, and reset
|
|
51
|
+
color.Color_RGB(196, 45, 118)
|
|
52
|
+
print("All of this text will render custom colored until reset...")
|
|
53
|
+
color.Reset_Color()
|
|
54
|
+
|
|
55
|
+
# Use built-in crisp presets
|
|
56
|
+
color.Print_Line_Color_RGB(3, 194, 252, "Built-in alternative line helper.")
|
|
57
|
+
color.Color("cyan", "Or print a preset line easily!")
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 2. BBCode Formatting (`style.py`)
|
|
61
|
+
Format your copy cleanly using semantic layout markers. Tags can be combined natively.
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from StyleUpText import style
|
|
65
|
+
|
|
66
|
+
# Format styles using lightweight structural tags
|
|
67
|
+
style.StylePrint("This is [b]bold[/b], this is [i]italic[/i], and this is [u]underlined[/u]!")
|
|
68
|
+
style.StylePrint("You can also apply [s]strikethrough text[/s] effortlessly.")
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. Decorative Big ASCII Typography
|
|
72
|
+
Render block headers using bundled typography matrices:
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from StyleUpText import style
|
|
76
|
+
|
|
77
|
+
# Print a styled headline banner
|
|
78
|
+
style.printFont("APLEXON", "slant")
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 🛠️ Built-in Terminal Commands
|
|
84
|
+
|
|
85
|
+
When you install **StyleUpText**, it automatically binds a native command directly to your machine's environment path.
|
|
86
|
+
|
|
87
|
+
### Find Pyfiglet Fonts
|
|
88
|
+
Search through over 570+ stylized block fonts directly inside your workspace shell:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
search-fonts <keyword>
|
|
92
|
+
```
|
|
93
|
+
*Example:* `search-fonts slant` will look up every accessible typography structure variation containing that name string.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 📂 Project Directory Structure
|
|
98
|
+
|
|
99
|
+
Ensure your local production folder matches this tree layout:
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
StyleUpText_Project/
|
|
103
|
+
├── pyproject.toml # Configuration, dependencies, and shell scripts
|
|
104
|
+
├── README.md # This documentation manual
|
|
105
|
+
└── src/
|
|
106
|
+
└── StyleUpText/ # Main distribution workspace module
|
|
107
|
+
├── __init__.py # Exports package layout functions cleanly
|
|
108
|
+
├── color.py # Hex, RGB, and palette engine
|
|
109
|
+
└── style.py # BBCode processing and ASCII typography
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Exposing Functions via `__init__.py`
|
|
113
|
+
To achieve the clean imports shown in the examples, place the following exposure declarations inside `src/StyleUpText/__init__.py`:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from . import color
|
|
117
|
+
from . import style
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 🤝 Contributing & Support
|
|
123
|
+
|
|
124
|
+
This engine is actively maintained by **Arin** ([contactarin@aplexon.com](mailto:contactarin@aplexon.com)). For feature requests or project portfolios, visit [aplexon.com](https://aplexon.com).
|
|
125
|
+
|
|
126
|
+
**License:** Aplexon StyleUpText Non-Commercial & Revocable License Agreement. Free for personal use. To use it commercially you must get a license for free by asking **Arin** at ([contactarin@aplexon.com](mailto:contactarin@aplexon.com)). __**This software license is revokable.**__
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# 🎨 StyleUpText
|
|
2
|
+
|
|
3
|
+
A high-performance, lightweight terminal text-styling engine that gives you pinpoint precision over your console typography.
|
|
4
|
+
|
|
5
|
+
**StyleUpText** bridges the gap between competing CLI packages: it lets you change terminal colors instantly using real **Hex codes** and **24-bit Truecolor RGB**, while utilizing lightweight **BBCode tags** exclusively for text formatting (bold, italic, etc.) without the parsing overhead of heavier frameworks. Brought to you by [Aplexon](https://aplexon.com).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🚀 Key Advantages
|
|
10
|
+
|
|
11
|
+
* **True Color Freedom:** Supports any Hex code (`#C42D76`) or RGB tuple directly. You are never restricted to primitive 8-color console palettes.
|
|
12
|
+
* **Decoupled Architecture:** Colors are handled dynamically via execution functions, while text styles use clean BBCode tags (`[b]`, `[i]`, `[u]`, `[s]`).
|
|
13
|
+
* **Zero-Dependency Color Layer:** The color engine uses raw ANSI streams, ensuring lightweight deployment with zero background parsing overhead.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 🛠️ Installation
|
|
18
|
+
|
|
19
|
+
Install the package directly via pip:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install StyleUpText
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 💻 Usage Examples
|
|
28
|
+
|
|
29
|
+
### 1. Hex & RGB Color Control (`color.py`)
|
|
30
|
+
Import the color sub-module to print precise truecolor lines or lock your terminal brush to a specific palette.
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from StyleUpText import color
|
|
34
|
+
|
|
35
|
+
# Print a specific line instantly using a hex code
|
|
36
|
+
color.Print_Line_Color_HEX("#C42D76", "This text is raspberry pink!")
|
|
37
|
+
|
|
38
|
+
# Lock the foreground color using RGB, print text, and reset
|
|
39
|
+
color.Color_RGB(196, 45, 118)
|
|
40
|
+
print("All of this text will render custom colored until reset...")
|
|
41
|
+
color.Reset_Color()
|
|
42
|
+
|
|
43
|
+
# Use built-in crisp presets
|
|
44
|
+
color.Print_Line_Color_RGB(3, 194, 252, "Built-in alternative line helper.")
|
|
45
|
+
color.Color("cyan", "Or print a preset line easily!")
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2. BBCode Formatting (`style.py`)
|
|
49
|
+
Format your copy cleanly using semantic layout markers. Tags can be combined natively.
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from StyleUpText import style
|
|
53
|
+
|
|
54
|
+
# Format styles using lightweight structural tags
|
|
55
|
+
style.StylePrint("This is [b]bold[/b], this is [i]italic[/i], and this is [u]underlined[/u]!")
|
|
56
|
+
style.StylePrint("You can also apply [s]strikethrough text[/s] effortlessly.")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 3. Decorative Big ASCII Typography
|
|
60
|
+
Render block headers using bundled typography matrices:
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from StyleUpText import style
|
|
64
|
+
|
|
65
|
+
# Print a styled headline banner
|
|
66
|
+
style.printFont("APLEXON", "slant")
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 🛠️ Built-in Terminal Commands
|
|
72
|
+
|
|
73
|
+
When you install **StyleUpText**, it automatically binds a native command directly to your machine's environment path.
|
|
74
|
+
|
|
75
|
+
### Find Pyfiglet Fonts
|
|
76
|
+
Search through over 570+ stylized block fonts directly inside your workspace shell:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
search-fonts <keyword>
|
|
80
|
+
```
|
|
81
|
+
*Example:* `search-fonts slant` will look up every accessible typography structure variation containing that name string.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 📂 Project Directory Structure
|
|
86
|
+
|
|
87
|
+
Ensure your local production folder matches this tree layout:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
StyleUpText_Project/
|
|
91
|
+
├── pyproject.toml # Configuration, dependencies, and shell scripts
|
|
92
|
+
├── README.md # This documentation manual
|
|
93
|
+
└── src/
|
|
94
|
+
└── StyleUpText/ # Main distribution workspace module
|
|
95
|
+
├── __init__.py # Exports package layout functions cleanly
|
|
96
|
+
├── color.py # Hex, RGB, and palette engine
|
|
97
|
+
└── style.py # BBCode processing and ASCII typography
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Exposing Functions via `__init__.py`
|
|
101
|
+
To achieve the clean imports shown in the examples, place the following exposure declarations inside `src/StyleUpText/__init__.py`:
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from . import color
|
|
105
|
+
from . import style
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 🤝 Contributing & Support
|
|
111
|
+
|
|
112
|
+
This engine is actively maintained by **Arin** ([contactarin@aplexon.com](mailto:contactarin@aplexon.com)). For feature requests or project portfolios, visit [aplexon.com](https://aplexon.com).
|
|
113
|
+
|
|
114
|
+
**License:** Aplexon StyleUpText Non-Commercial & Revocable License Agreement. Free for personal use. To use it commercially you must get a license for free by asking **Arin** at ([contactarin@aplexon.com](mailto:contactarin@aplexon.com)). __**This software license is revokable.**__
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "StyleUpText"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "The best method to style text. Better than Rich + colorama"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = "LicenseRef-Proprietary"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
|
|
14
|
+
authors = [
|
|
15
|
+
{ name = "Arin Singla", email = "contactarin@aplexon.com" }
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
dependencies = [
|
|
20
|
+
"pyfiglet>=1.0.2",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.scripts]
|
|
24
|
+
search-fonts = "TextStyle.style:SearchFonts"
|
|
File without changes
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
reset = "\033[0m"
|
|
2
|
+
def hex_to_rgb(hex_str):
|
|
3
|
+
# Remove the '#' if it's present
|
|
4
|
+
hex_str = hex_str.lstrip('#')
|
|
5
|
+
|
|
6
|
+
# Convert each 2-character pair from hex (base 16) to decimal
|
|
7
|
+
return tuple(int(hex_str[i:i+2], 16) for i in (0, 2, 4))
|
|
8
|
+
|
|
9
|
+
def Color_RGB(r, g, b):
|
|
10
|
+
print(f"\033[38;2;{r};{g};{b}m",end='')
|
|
11
|
+
|
|
12
|
+
def Color_HEX(hex):
|
|
13
|
+
new_rgb = hex_to_rgb(hex)
|
|
14
|
+
print(f"\033[38;2;{new_rgb[0]};{new_rgb[1]};{new_rgb[2]}m",end='')
|
|
15
|
+
|
|
16
|
+
def Reset_Color():
|
|
17
|
+
print(reset)
|
|
18
|
+
|
|
19
|
+
def Print_Line_Color_HEX(hex, text):
|
|
20
|
+
new_rgb = hex_to_rgb(hex)
|
|
21
|
+
print(f"\033[38;2;{new_rgb[0]};{new_rgb[1]};{new_rgb[2]}m{text}{reset}")
|
|
22
|
+
|
|
23
|
+
def Print_Line_Color_RGB(r,g,b, text):
|
|
24
|
+
print(f"\033[38;2;{r};{g};{b}m{text}{reset}")
|
|
25
|
+
|
|
26
|
+
def Color(coltemp):
|
|
27
|
+
col = coltemp.strip().lower()
|
|
28
|
+
if col == 'red':
|
|
29
|
+
print("\033[38;2;252;3;3m",end='')
|
|
30
|
+
elif col == 'orange':
|
|
31
|
+
print("\033[38;2;252;119;3m",end='')
|
|
32
|
+
elif col == 'yellow':
|
|
33
|
+
print("\033[38;2;252;232;3m",end='')
|
|
34
|
+
elif col == 'green':
|
|
35
|
+
print("\033[38;2;3;252;3m",end='')
|
|
36
|
+
elif col == 'cyan':
|
|
37
|
+
print("\033[38;2;3;194;252m",end='')
|
|
38
|
+
elif col == 'blue':
|
|
39
|
+
print("\033[38;2;3;74;252m",end='')
|
|
40
|
+
elif col == 'violet':
|
|
41
|
+
print("\033[38;2;119;3;252m",end='')
|
|
42
|
+
elif col == 'magenta':
|
|
43
|
+
print("\033[38;2;252;3;169m",end='')
|
|
44
|
+
else:
|
|
45
|
+
print(f"\033[38;2;252;3;3mThat is not a predefined color.{reset}")
|
|
46
|
+
return False
|
|
47
|
+
|
|
48
|
+
def Print_Line_Color(coltemp,text):
|
|
49
|
+
col = coltemp.strip().lower()
|
|
50
|
+
if col == 'red':
|
|
51
|
+
print(f"\033[38;2;252;3;3m{text}{reset}")
|
|
52
|
+
elif col == 'orange':
|
|
53
|
+
print(f"\033[38;2;252;119;3m{text}{reset}")
|
|
54
|
+
elif col == 'yellow':
|
|
55
|
+
print(f"\033[38;2;252;232;3m{text}{reset}")
|
|
56
|
+
elif col == 'green':
|
|
57
|
+
print(f"\033[38;2;3;252;3m{text}{reset}")
|
|
58
|
+
elif col == 'cyan':
|
|
59
|
+
print(f"\033[38;2;3;194;252m{text}{reset}")
|
|
60
|
+
elif col == 'blue':
|
|
61
|
+
print(f"\033[38;2;3;74;252m{text}{reset}")
|
|
62
|
+
elif col == 'violet':
|
|
63
|
+
print(f"\033[38;2;119;3;252m{text}{reset}")
|
|
64
|
+
elif col == 'magenta':
|
|
65
|
+
print(f"\033[38;2;252;3;169m{text}{reset}")
|
|
66
|
+
else:
|
|
67
|
+
print(f"\033[38;2;252;3;3mThat is not a predefined color.{reset}")
|
|
68
|
+
return False
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import re
|
|
2
|
+
import sys
|
|
3
|
+
import pyfiglet
|
|
4
|
+
def StylePrint(text):
|
|
5
|
+
# Map BBCode tags to ANSI opening and closing sequences
|
|
6
|
+
replacements = {
|
|
7
|
+
r'\[b\]': '\033[1m', r'\[/b\]': '\033[22m', # 22 resets bold
|
|
8
|
+
r'\[i\]': '\033[3m', r'\[/i\]': '\033[23m', # 23 resets italic
|
|
9
|
+
r'\[u\]': '\033[4m', r'\[/u\]': '\033[24m', # 24 resets underline
|
|
10
|
+
r'\[s\]': '\033[9m', r'\[/s\]': '\033[29m', # 29 resets strikethrough
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
# Process the text and replace tags
|
|
14
|
+
for tag, ansi in replacements.items():
|
|
15
|
+
text = re.sub(tag, ansi, text)
|
|
16
|
+
|
|
17
|
+
# Append a global reset (\033[0m) at the end just to be safe
|
|
18
|
+
print(text + '\033[0m')
|
|
19
|
+
|
|
20
|
+
def printFont(text, fontx):
|
|
21
|
+
ascii_font = pyfiglet.figlet_format(text, font=fontx)
|
|
22
|
+
print(ascii_font)
|
|
23
|
+
|
|
24
|
+
def SearchFonts():
|
|
25
|
+
# 1. Grab all 570+ available font strings
|
|
26
|
+
all_fonts = pyfiglet.FigletFont.getFonts()
|
|
27
|
+
|
|
28
|
+
# 2. Check if the user passed a search keyword argument
|
|
29
|
+
if len(sys.argv) < 2:
|
|
30
|
+
print("\033[91m⚠️ Error: Please provide a search term.\033[0m")
|
|
31
|
+
print("Usage: figlet-find <keyword>")
|
|
32
|
+
sys.exit(1)
|
|
33
|
+
|
|
34
|
+
keyword = sys.argv[1].lower()
|
|
35
|
+
|
|
36
|
+
# 3. Filter the font list
|
|
37
|
+
matches = [font for font in all_fonts if keyword in font.lower()]
|
|
38
|
+
|
|
39
|
+
# 4. Display the results cleanly
|
|
40
|
+
print(f"\n🔍 Searching for pyfiglet fonts containing: '\033[95m{keyword}\033[0m'")
|
|
41
|
+
print("─" * 50)
|
|
42
|
+
|
|
43
|
+
if not matches:
|
|
44
|
+
print("❌ No matching fonts found.")
|
|
45
|
+
else:
|
|
46
|
+
print(f"✅ Found {len(matches)} matching fonts:")
|
|
47
|
+
for font in matches:
|
|
48
|
+
print(f" • {font}")
|
|
49
|
+
print("─" * 50 + "\n")
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: StyleUpText
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The best method to style text. Better than Rich + colorama
|
|
5
|
+
Author-email: Arin Singla <contactarin@aplexon.com>
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: pyfiglet>=1.0.2
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# 🎨 StyleUpText
|
|
14
|
+
|
|
15
|
+
A high-performance, lightweight terminal text-styling engine that gives you pinpoint precision over your console typography.
|
|
16
|
+
|
|
17
|
+
**StyleUpText** bridges the gap between competing CLI packages: it lets you change terminal colors instantly using real **Hex codes** and **24-bit Truecolor RGB**, while utilizing lightweight **BBCode tags** exclusively for text formatting (bold, italic, etc.) without the parsing overhead of heavier frameworks. Brought to you by [Aplexon](https://aplexon.com).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🚀 Key Advantages
|
|
22
|
+
|
|
23
|
+
* **True Color Freedom:** Supports any Hex code (`#C42D76`) or RGB tuple directly. You are never restricted to primitive 8-color console palettes.
|
|
24
|
+
* **Decoupled Architecture:** Colors are handled dynamically via execution functions, while text styles use clean BBCode tags (`[b]`, `[i]`, `[u]`, `[s]`).
|
|
25
|
+
* **Zero-Dependency Color Layer:** The color engine uses raw ANSI streams, ensuring lightweight deployment with zero background parsing overhead.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🛠️ Installation
|
|
30
|
+
|
|
31
|
+
Install the package directly via pip:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install StyleUpText
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 💻 Usage Examples
|
|
40
|
+
|
|
41
|
+
### 1. Hex & RGB Color Control (`color.py`)
|
|
42
|
+
Import the color sub-module to print precise truecolor lines or lock your terminal brush to a specific palette.
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from StyleUpText import color
|
|
46
|
+
|
|
47
|
+
# Print a specific line instantly using a hex code
|
|
48
|
+
color.Print_Line_Color_HEX("#C42D76", "This text is raspberry pink!")
|
|
49
|
+
|
|
50
|
+
# Lock the foreground color using RGB, print text, and reset
|
|
51
|
+
color.Color_RGB(196, 45, 118)
|
|
52
|
+
print("All of this text will render custom colored until reset...")
|
|
53
|
+
color.Reset_Color()
|
|
54
|
+
|
|
55
|
+
# Use built-in crisp presets
|
|
56
|
+
color.Print_Line_Color_RGB(3, 194, 252, "Built-in alternative line helper.")
|
|
57
|
+
color.Color("cyan", "Or print a preset line easily!")
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 2. BBCode Formatting (`style.py`)
|
|
61
|
+
Format your copy cleanly using semantic layout markers. Tags can be combined natively.
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from StyleUpText import style
|
|
65
|
+
|
|
66
|
+
# Format styles using lightweight structural tags
|
|
67
|
+
style.StylePrint("This is [b]bold[/b], this is [i]italic[/i], and this is [u]underlined[/u]!")
|
|
68
|
+
style.StylePrint("You can also apply [s]strikethrough text[/s] effortlessly.")
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. Decorative Big ASCII Typography
|
|
72
|
+
Render block headers using bundled typography matrices:
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from StyleUpText import style
|
|
76
|
+
|
|
77
|
+
# Print a styled headline banner
|
|
78
|
+
style.printFont("APLEXON", "slant")
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 🛠️ Built-in Terminal Commands
|
|
84
|
+
|
|
85
|
+
When you install **StyleUpText**, it automatically binds a native command directly to your machine's environment path.
|
|
86
|
+
|
|
87
|
+
### Find Pyfiglet Fonts
|
|
88
|
+
Search through over 570+ stylized block fonts directly inside your workspace shell:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
search-fonts <keyword>
|
|
92
|
+
```
|
|
93
|
+
*Example:* `search-fonts slant` will look up every accessible typography structure variation containing that name string.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 📂 Project Directory Structure
|
|
98
|
+
|
|
99
|
+
Ensure your local production folder matches this tree layout:
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
StyleUpText_Project/
|
|
103
|
+
├── pyproject.toml # Configuration, dependencies, and shell scripts
|
|
104
|
+
├── README.md # This documentation manual
|
|
105
|
+
└── src/
|
|
106
|
+
└── StyleUpText/ # Main distribution workspace module
|
|
107
|
+
├── __init__.py # Exports package layout functions cleanly
|
|
108
|
+
├── color.py # Hex, RGB, and palette engine
|
|
109
|
+
└── style.py # BBCode processing and ASCII typography
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Exposing Functions via `__init__.py`
|
|
113
|
+
To achieve the clean imports shown in the examples, place the following exposure declarations inside `src/StyleUpText/__init__.py`:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from . import color
|
|
117
|
+
from . import style
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 🤝 Contributing & Support
|
|
123
|
+
|
|
124
|
+
This engine is actively maintained by **Arin** ([contactarin@aplexon.com](mailto:contactarin@aplexon.com)). For feature requests or project portfolios, visit [aplexon.com](https://aplexon.com).
|
|
125
|
+
|
|
126
|
+
**License:** Aplexon StyleUpText Non-Commercial & Revocable License Agreement. Free for personal use. To use it commercially you must get a license for free by asking **Arin** at ([contactarin@aplexon.com](mailto:contactarin@aplexon.com)). __**This software license is revokable.**__
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/StyleUpText/__init__.py
|
|
5
|
+
src/StyleUpText/color.py
|
|
6
|
+
src/StyleUpText/style.py
|
|
7
|
+
src/StyleUpText.egg-info/PKG-INFO
|
|
8
|
+
src/StyleUpText.egg-info/SOURCES.txt
|
|
9
|
+
src/StyleUpText.egg-info/dependency_links.txt
|
|
10
|
+
src/StyleUpText.egg-info/entry_points.txt
|
|
11
|
+
src/StyleUpText.egg-info/requires.txt
|
|
12
|
+
src/StyleUpText.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyfiglet>=1.0.2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
StyleUpText
|