Skip to main content

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


Download files

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

Source Distribution

termstyler-2.1.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

termstyler-2.1.1-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

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

Hashes for termstyler-2.1.1.tar.gz
Algorithm Hash digest
SHA256 438c354ceb047351619a0c3e9076491f9577a256cff4b63d2fd44f0c9b611c2e
MD5 59cbd94d26cd8e0a4c4176cc8c40293b
BLAKE2b-256 5ae094c87664dc3573c8f1e135051e815769720f337c87300514ceb4d7f39ac9

See more details on using hashes here.

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

Hashes for termstyler-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ce0b559b6b6c5bf68f3f8359129b1944d603f962661dd6642114c52c0b77923
MD5 ff64074cc2a54109c29984cde035a270
BLAKE2b-256 6641a7fc96a265732ac2db2c84bfeb7a1156edd40e70ad91fcbe8ae2241f5403

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