Skip to main content

A python library for styling terminal outputs.

Project description

☄️  Pybeaut ☄️

A Python module to stylize terminal outputs with colors, fades, boxes, and animations.

PyPI version Python versions License


Installation

pip install pybeaut

🔰 Features

  • ✅ 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)

❗ PLEASE NOTE

[!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.


Quick Start

from pybeaut import Colorate, Colors

print(Colorate.Color(Colors.cyan, "Hello from Pybeaut!"))

🎨 Colorate

The core of Pybeaut. Apply static colors or gradient fades to any text.

Static color

from pybeaut import Colorate, Colors

print(Colorate.Color(Colors.green,  "This is green"))

Static colors

Vertical fade

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))

Vertical fade

Horizontal fade

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!"))

Horizontal fade

Diagonal fade

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))

Diagonal fade

Diagonal Backwards

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))

Diagonal Backwards

Format — accent characters

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
))

Available colors

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

↔️ Center

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))

XCenter

Text alignment within a block

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)))

➕ Add

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))

Add blocks


🏷️ Banner

Decorative text banners using lines and arrows.

Lines banner

from pybeaut import Banner, Colors

print(Banner.Lines("Welcome to Pybeaut", color=Colors.blue_to_purple))

Banner Lines

ASCII art banner with centered text

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))

ASCII art banner

Arrow

from pybeaut import Banner, Colorate, Colors

arrow = Banner.Arrow(icon='▶', size=2, number=3, direction='right')
print(Colorate.Vertical(Colors.green_to_cyan, arrow))

Arrow


✨ Fade Effect — Write & Colors

Write.Print types text character by character with a live color gradient — great for intros and prompts.

Write.Print

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
)

Write.Input

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}!")

Custom color with StaticRGB

from pybeaut import Colors, Colorate

salmon = Colors.StaticRGB(250, 128, 114)
print(Colorate.Color(salmon, "Custom salmon color via RGB!"))

Mix two static colors

from pybeaut import Colors, Colorate

mixed = Colors.StaticMIX([Colors.red, Colors.blue])
print(Colorate.Color(mixed, "Red + Blue mixed = Purple-ish"))

📦 Boxes

Wrap text inside ASCII or Unicode boxes.

Simple box

from pybeaut import Banner, Colorate, Colors

box = Banner.SimpleCube("Hello, Pybeaut!")
print(Colorate.Color(Colors.cyan, box))

Double-line Unicode 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))

Custom characters

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))

Boxes


⚙️ System Functions

Utilities for terminal management.

Initialize and set terminal title (Windows)

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}"))

Check RGB color support

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."))

Terminal size

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"))

Recommendations

If you have recommendations or ideas for new features, open an issue on the official repository or submit a request on PyPI.

Owner

This project follows Semantic Versioning

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybeaut-1.1.5.tar.gz (160.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybeaut-1.1.5-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file pybeaut-1.1.5.tar.gz.

File metadata

  • Download URL: pybeaut-1.1.5.tar.gz
  • Upload date:
  • Size: 160.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pybeaut-1.1.5.tar.gz
Algorithm Hash digest
SHA256 dc8e4742c001fc2161490c666785e05a43af84f3047dfc578d2e7d22cae7d63f
MD5 b7cc2707585b1faae15fa456ea7f2125
BLAKE2b-256 eee9aceffe57a5e94fe1ce1c7a7d669da097b3ff677c7289cd908180766ddb98

See more details on using hashes here.

File details

Details for the file pybeaut-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: pybeaut-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pybeaut-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 911642a0ed40739021104f166055a25138aa022d78d6855018172bfeea05d644
MD5 8b9788a7e41240660b2c5e2c2305e4bf
BLAKE2b-256 1fdb4f9b25e51c780628728cf8d413905c17a18685c709695610f91002307f38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page