pip
pip install pybeautuv (recommended)
uv add pybeaut# Run a script directly β uv resolves the environment automatically
uv run python my_script.py# Create and activate the environment
uv venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux / macOS
uv pip install pybeaut
python my_script.py- β Static & dynamic RGB colors
- β Colorate texts (vertical, horizontal, diagonal fades)
- β Center and align texts
- β Combine banners side by side
- β Text boxes and banners
- β Animated write effect with color fade
- β System utilities (clear, title, size)
Important
This module uses RGB color representations to perform color operations such as fades and gradients. Some terminals may not support this functionality, especially in non-Windows 10/11 environments. Make sure your terminal supports RGB colors to avoid display issues.
from pybeaut import Colorate, Colors
print(Colorate.Color(Colors.cyan, "Hello from Pybeaut!"))The core of Pybeaut. Apply static colors or gradient fades to any text.
from pybeaut import Colorate, Colors
print(Colorate.Color(Colors.green, "This is green"))Each line gets a different color step along the gradient.
from pybeaut import Colorate, Colors
text = (
"Pybeaut vertical fade\n"
"Every line shifts color\n"
"Red bleeds into blue\n"
"Smoothly, line by line"
)
print(Colorate.Vertical(Colors.red_to_blue, text))Each character on a line gets a different color step.
from pybeaut import Colorate, Colors
print(Colorate.Horizontal(Colors.blue_to_purple, "Horizontal fade β every character shifts color across the line!"))The gradient travels diagonally across both lines and characters.
from pybeaut import Colorate, Colors
text = (
"Diagonal color fade\n"
"The gradient moves\n"
"Across lines and chars\n"
"Like a slanted rainbow"
)
print(Colorate.Diagonal(Colors.green_to_blue, text))Same as diagonal but the gradient goes from right to left.
from pybeaut import Colorate, Colors
text = (
"Backwards diagonal\n"
"Gradient reversed\n"
"Right side is brighter"
)
print(Colorate.DiagonalBackwards(Colors.yellow_to_red, text))Apply a fade to the main text and a separate color to specific accent characters.
from pybeaut import Colorate, Colors
text = (
"[ Pybeaut ]\n"
"[ Colors ]\n"
"[ Format ]"
)
print(Colorate.Format(
text,
second_chars=["[", "]"],
mode=Colorate.Vertical,
principal_col=Colors.blue_to_cyan,
second_col=Colors.white
))Static (use with Colorate.Color):
| Name | ||||
|---|---|---|---|---|
Colors.red |
Colors.green |
Colors.blue |
||
Colors.cyan |
Colors.yellow |
Colors.purple |
||
Colors.orange |
Colors.pink |
Colors.turquoise |
||
Colors.white |
Colors.gray |
Colors.light_gray |
||
Colors.light_red |
Colors.light_green |
Colors.light_blue |
||
Colors.dark_red |
Colors.dark_green |
Colors.dark_blue |
Dynamic (use with Colorate.Vertical, Horizontal, Diagonal):
black_to_white black_to_red black_to_green black_to_blue
white_to_black white_to_red white_to_green white_to_blue
red_to_blue red_to_green red_to_yellow red_to_purple
green_to_blue green_to_red green_to_yellow green_to_cyan
blue_to_red blue_to_green blue_to_cyan blue_to_purple
yellow_to_red yellow_to_green purple_to_red purple_to_blue
cyan_to_green cyan_to_blue rainbow
Align text relative to the terminal window.
from pybeaut import Center, Colorate, Colors
logo = (
" ____ _ _ \n"
" | _ \ _ _| |__ ___ __ _ _ _| |_ \n"
" | |_) | | | | '_ \ / _ \/ _` | | | | __|\n"
" | __/| |_| | |_) | __/ (_| | |_| | |_ \n"
" |_| \__, |_.__/ \___|\__,_|\__,_|\__|\n"
" |___/ "
)
colored = Colorate.Vertical(Colors.blue_to_cyan, logo)
print(Center.XCenter(colored))from pybeaut import Center, Colorate, Colors
text = "Short\nA longer line here\nMedium line"
print("--- CENTER ---")
print(Colorate.Color(Colors.cyan, Center.TextAlign(text, align=Center.center)))
print("--- RIGHT ---")
print(Colorate.Color(Colors.yellow, Center.TextAlign(text, align=Center.right)))Place two text blocks side by side, with optional vertical centering.
from pybeaut import Add, Colorate, Colors
left = Colorate.Vertical(Colors.red_to_yellow,
" βββββββ \n"
"βββββββββ\n"
"βββ βββ\n"
"βββββββββ\n"
" βββββββ "
)
right = Colorate.Vertical(Colors.blue_to_cyan,
"βββββββ \n"
"ββββββββ\n"
"ββββββββ\n"
"ββββββββ\n"
"ββββββββ\n"
"βββββββ "
)
print(Add.Add(left, right, center=True))Decorative text banners using lines and arrows.
from pybeaut import Banner, Colors
print(Banner.Lines("Welcome to Pybeaut", color=Colors.blue_to_purple))Use Add.Add to place a text block vertically centered next to an ASCII art banner.
from pybeaut import Add, Center, Colorate, Colors
whale = r""" .
":"
___:____ |"\/"|
,' `. \ /
| O \___/ |
~^~^~^~^~^~^~^~^~^~^~^~^~"""
info = (
" Pybeaut \n"
" v1.1.1 \n"
" \n"
" by Backist "
)
colored_whale = Colorate.Vertical(Colors.blue_to_cyan, whale)
colored_info = Colorate.Vertical(Colors.cyan_to_blue, info)
banner = Add.Add(colored_whale, colored_info, center=True)
print(Center.XCenter(banner))from pybeaut import Banner, Colorate, Colors
arrow = Banner.Arrow(icon='βΆ', size=2, number=3, direction='right')
print(Colorate.Vertical(Colors.green_to_cyan, arrow))Write.Print types text character by character with a live color gradient β great for intros and prompts.
from pybeaut import Write, Colors
Write.Print(
"\nWelcome to Pybeaut!\n"
"Every character appears one by one\n"
"with a smooth color fade.\n\n",
Colors.blue_to_purple,
interval=0.03
)from pybeaut import Write, Colors
answer = Write.Input(
"\nEnter your name: ",
Colors.green_to_cyan,
interval=0.04,
input_color=Colors.white
)
print(f"\nHello, {answer}!")from pybeaut import Colors, Colorate
salmon = Colors.StaticRGB(250, 128, 114)
print(Colorate.Color(salmon, "Custom salmon color via RGB!"))from pybeaut import Colors, Colorate
mixed = Colors.StaticMIX([Colors.red, Colors.blue])
print(Colorate.Color(mixed, "Red + Blue mixed = Purple-ish"))Wrap text inside ASCII or Unicode boxes.
from pybeaut import Banner, Colorate, Colors
box = Banner.SimpleCube("Hello, Pybeaut!")
print(Colorate.Color(Colors.cyan, box))from pybeaut import Banner, Colorate, Colors
box = Banner.Box(
"Pybeaut\nDouble Box",
up_left="ββ", up_right="ββ",
down_left="ββ", down_right="ββ",
left_line="β", right_line="β",
up_line="β", down_line="β"
)
print(Colorate.Vertical(Colors.blue_to_cyan, box))from pybeaut import Banner, Colorate, Colors
box = Banner.Box(
"Custom\nBox Style",
up_left="ββ", up_right="ββ",
down_left="ββ", down_right="ββ",
left_line="β", right_line="β",
up_line="β", down_line="β"
)
print(Colorate.Vertical(Colors.purple_to_blue, box))Utilities for terminal management.
from pybeaut import System, Colorate, Colors
System.Title("My Pybeaut App") # Windows only
print(Colorate.Color(Colors.green, "Terminal ready!"))
print(Colorate.Color(Colors.yellow, f"Running on Windows: {System.Windows}"))from pybeaut import System, Colorate, Colors
if System.Windows:
print(Colorate.Color(Colors.green, "Windows detected β RGB colors fully supported."))
print(Colorate.Color(Colors.cyan, "You can use all Colorate fade functions."))
else:
print(Colorate.Color(Colors.yellow, "Non-Windows system β RGB support depends on terminal."))
print(Colorate.Color(Colors.orange, "Most modern terminals (iTerm2, GNOME) work fine."))from pybeaut import System, Colorate, Colors
from os import get_terminal_size
size = get_terminal_size()
print(Colorate.Color(Colors.cyan, f"Terminal size: {size.columns} cols Γ {size.lines} rows"))
# Resize (Windows only)
if System.Windows:
System.Size(120, 30)
print(Colorate.Color(Colors.green, "Terminal resized to 120x30"))If you have recommendations or ideas for new features, open an issue on the official repository or submit a request on PyPI.
This project follows Semantic Versioning










