A terminal styling library with colors, backgrounds, and text effects
Project description
TermStyler 🎨✨
A lightweight Python library for adding colors, backgrounds, and text styles to terminal output.
🌟 Features
✅ Supports 16 colors (normal & bright)
✅ RGB colors for custom styling
✅ Text styles (bold, italic, underline, etc.)
✅ Background colors
✅ Works on Windows, Linux, and macOS
Installation:
pip install termstyler
Usage
Importing the Library
from termstyler import TermStyler
Basic Colors
print(TermStyler.color("Hello in bright blue!", "bright_blue"))
print(TermStyler.color("This is red text!", "red"))
print(TermStyler.color("Cyan colored text!", "cyan"))
Text Styles
print(TermStyler.style("Bold text!", "bold"))
print(TermStyler.style("Italic text!", "italic"))
print(TermStyler.style("Underlined text!", "underline"))
Background Colors
print(TermStyler.background("Text with red background!", "red"))
print(TermStyler.background("Blue background!", "blue"))
RGB Colors
print(TermStyler.rgb(255, 165, 0, "Orange Text!"))
print(TermStyler.bg_rgb(0, 255, 0, "Green Background!"))
🛠 Full API Reference
TermStyler.color(text, color)
✔ Changes the color of the text
✔ Example:
TermStyler.color("Hello", "blue")
TermStyler.background(text, bg_color)
✔ Changes the background color of text
✔ Example:
TermStyler.background("Text with red background", "red")
TermStyler.style(text, style)
✔ Applies a text style (bold, italic, etc.)
✔ Example:
TermStyler.style("Bold text!", "bold")
TermStyler.rgb(r, g, b, text)
✔ Sets text color using RGB values
✔ Example:
TermStyler.rgb(255, 165, 0, "Orange Text!")
TermStyler.bg_rgb(r, g, b, text)
✔ Sets background color using RGB values
✔ Example:
TermStyler.bg_rgb(0, 255, 0, "Green Background!")
🎭 Available Styles & Colors
| Type | Options |
|---|---|
| Colors | black, red, green, yellow, blue, magenta, cyan, white (also bright_ versions) |
| Text Styles | bold, dim, italic, underline, blink, reverse, hidden |
| Backgrounds | Same as text colors |
📜 License
This project is licensed under the MIT License.
🤝 Contributing
Pull requests are welcome! If you have ideas, feel free to open an issue.
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 termstyler-2.1.1.tar.gz.
File metadata
- Download URL: termstyler-2.1.1.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
438c354ceb047351619a0c3e9076491f9577a256cff4b63d2fd44f0c9b611c2e
|
|
| MD5 |
59cbd94d26cd8e0a4c4176cc8c40293b
|
|
| BLAKE2b-256 |
5ae094c87664dc3573c8f1e135051e815769720f337c87300514ceb4d7f39ac9
|
File details
Details for the file termstyler-2.1.1-py3-none-any.whl.
File metadata
- Download URL: termstyler-2.1.1-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ce0b559b6b6c5bf68f3f8359129b1944d603f962661dd6642114c52c0b77923
|
|
| MD5 |
ff64074cc2a54109c29984cde035a270
|
|
| BLAKE2b-256 |
6641a7fc96a265732ac2db2c84bfeb7a1156edd40e70ad91fcbe8ae2241f5403
|