A Python library for creating and applying full-color, linear, and circular gradients to text with easy color management.
Project description
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
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rich_style-1.1.6.tar.gz.
File metadata
- Download URL: rich_style-1.1.6.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
511b570cdb2f034efd14f141852c47a254ac5cf7a157146a1f017cc179c3de01
|
|
| MD5 |
9b2ed01a7bae2f0b5637090fa55b5f71
|
|
| BLAKE2b-256 |
1444d0aa1ae15a98cf5175ef6993c1cf1c385ca4b471f36c6f9298a1f8ec851f
|
Provenance
The following attestation bundles were made for rich_style-1.1.6.tar.gz:
Publisher:
release.yaml on PcoiDev/rich-style
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rich_style-1.1.6.tar.gz -
Subject digest:
511b570cdb2f034efd14f141852c47a254ac5cf7a157146a1f017cc179c3de01 - Sigstore transparency entry: 760399673
- Sigstore integration time:
-
Permalink:
PcoiDev/rich-style@37ebc19040d6502cbb89fb354eda612e2e21306b -
Branch / Tag:
refs/tags/v1.1.6 - Owner: https://github.com/PcoiDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@37ebc19040d6502cbb89fb354eda612e2e21306b -
Trigger Event:
release
-
Statement type:
File details
Details for the file rich_style-1.1.6-py3-none-any.whl.
File metadata
- Download URL: rich_style-1.1.6-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fc89a36d594ddd1984bda9bd8ea0186c034ea4d2129c778610edd9a67e6aaa5
|
|
| MD5 |
b35fc112b80f6e13699d3e6a978ed9e4
|
|
| BLAKE2b-256 |
13b5ce04a9d70c1f8b5b084d20ab074152bfd049865b22d2a3d249cae2006d8a
|
Provenance
The following attestation bundles were made for rich_style-1.1.6-py3-none-any.whl:
Publisher:
release.yaml on PcoiDev/rich-style
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rich_style-1.1.6-py3-none-any.whl -
Subject digest:
6fc89a36d594ddd1984bda9bd8ea0186c034ea4d2129c778610edd9a67e6aaa5 - Sigstore transparency entry: 760399682
- Sigstore integration time:
-
Permalink:
PcoiDev/rich-style@37ebc19040d6502cbb89fb354eda612e2e21306b -
Branch / Tag:
refs/tags/v1.1.6 - Owner: https://github.com/PcoiDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@37ebc19040d6502cbb89fb354eda612e2e21306b -
Trigger Event:
release
-
Statement type: