Socket
Book a DemoInstallSign in
Socket

rich-style

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rich-style

A Python library for creating and applying full-color, linear, and circular gradients to text with easy color management.

pipPyPI
Version
1.1.2
Maintainers
1

rich-style

A Python library for creating and applying full-color, linear, and circular gradients to text with easy color management. Includes utilities for ANSI styling, colored prints, and more.

Features

  • Text Styling: Bold, italic, underline, strikethrough, bullet lists, and more.
  • Color Management: Use named presets, custom RGB, gradients, and HSL/HTML color parsing.
  • Gradients: Linear and circular gradients for text.
  • ANSI Support: Automatically detects terminal support for ANSI escape codes.
  • Utility Prints: Info, warning, error, success, timed, and mutable prints with color.
  • Composable: Combine styles and colors easily.

Installation

pip install rich-style

Usage

Basic Styling

from rich_style import bold, italic, underline, strikethrough

print(bold("Bold text"))
print(italic("Italic text"))
print(underline("Underlined text"))
print(strikethrough("Strikethrough text"))

Bullet Lists

from rich_style import bullet_list, bold

tasks = [
    "Complete report",
    "Send email to client",
    "Buy groceries"
]

print(bold("Task List:"))
print(bullet_list(*tasks))

Colors and Gradients

from rich_style import presets, foreground, background

print(foreground(presets.red, "Red text"))
print(background(presets.blue, "Text with blue background"))

Colors and Gradients

from rich_style import presets, foreground, background

print(foreground(presets.red, "Red text"))
print(background(presets.blue, "Text with blue background"))

Rainbow Text

from rich_style import rainbow_text
print(rainbow_text("This is a rainbow text message."))

Utility Prints

from rich_style import info, success, warn, error, timed_print

info("This is an informational message.")
success("This is a success message.")
warn("This is a warning message.")
error("This is an error message.")
timed_print("This is a timed print message.")

Mutable Print

from rich_style import mutable_print
from time import sleep

mutable = mutable_print("Loading")
sleep(1)
mutable("Still loading...")
sleep(1)
mutable("Done!\n")

[!WARNING]
You can only use a mutable print when it's the last print.

Examples

See the examples/ directory for more usage examples.

Credits

  • Author: PcoiDev
  • Inspiration: colorama, rich and stylepy.

License

This project is licensed under the MIT License.

Keywords

python

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.