Add color to Linux CLI shell terminal output in ANSI
Project description
🌈 shellcolorize
shellcolorize is a lightweight Python library for adding color to terminal text using ANSI color codes. This library makes it easy to style your command-line output with vibrant colors and backgrounds, perfect for enhancing readability and making CLI applications more visually appealing.
✨ Features
- 🌈 Wide Range of Colors: Includes standard text and background colors.
- 🚀 Easy to Use: Simple and intuitive API to add color to terminal text.
- 💡 ANSI Standard: Uses ANSI color codes, compatible with most Unix-based terminals and compatible environments.
- 🔗 Open Source: Licensed under the MIT License.
📥 Installation
Install shellcolorize from PyPI:
pip install shellcolorize
🛠 Usage
shellcolorize makes it easy to color your terminal text. Import Color from shellcolorize and use the color attributes as shown below.
Basic Usage
from shellcolorize import Color
print(f"{Color.RED}This is red text{Color.RESET}")
print(f"{Color.GREEN}This is green text{Color.RESET}")
Using Background Colors
from shellcolorize import Color
print(f"{Color.BG_YELLOW}{Color.BLACK}Black text on yellow background{Color.RESET}")
print(f"{Color.BG_BLUE}{Color.WHITE}White text on blue background{Color.RESET}")
Combining Text and Background Colors
from shellcolorize import Color
print(f"{Color.BG_RED}{Color.CYAN}Cyan text on red background{Color.RESET}")
print(f"{Color.BG_GREEN}{Color.MAGENTA}Magenta text on green background{Color.RESET}")
🎨 Available Colors
Text Colors
| Color | Usage Example |
|---|---|
| Black | {Color.BLACK}Text{Color.RESET} |
| Red | {Color.RED}Text{Color.RESET} |
| Green | {Color.GREEN}Text{Color.RESET} |
| Yellow | {Color.YELLOW}Text{Color.RESET} |
| Blue | {Color.BLUE}Text{Color.RESET} |
| Magenta | {Color.MAGENTA}Text{Color.RESET} |
| Cyan | {Color.CYAN}Text{Color.RESET} |
| White | {Color.WHITE}Text{Color.RESET} |
Background Colors
| Color | Usage Example |
|---|---|
| Black | {Color.BG_BLACK}Text{Color.RESET} |
| Red | {Color.BG_RED}Text{Color.RESET} |
| Green | {Color.BG_GREEN}Text{Color.RESET} |
| Yellow | {Color.BG_YELLOW}Text{Color.RESET} |
| Blue | {Color.BG_BLUE}Text{Color.RESET} |
| Magenta | {Color.BG_MAGENTA}Text{Color.RESET} |
| Cyan | {Color.BG_CYAN}Text{Color.RESET} |
| White | {Color.BG_WHITE}Text{Color.RESET} |
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
💬 Feedback
If you have any questions, issues, or suggestions, please feel free to open an issue in the repository or contact me directly via GitHub.
🌐 Connect with Me
🚀 Let's bring more color to the command line with shellcolorize!
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 shellcolorize-0.3.tar.gz.
File metadata
- Download URL: shellcolorize-0.3.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
672e37c5057c0dd1e45fdcc537e5761ed52e9c43066ea27b390a6c69f197a61c
|
|
| MD5 |
e7af2b5dcf63f9a7e92dee03ab7c9e46
|
|
| BLAKE2b-256 |
63ea0bf0e31307338010e0679035b0d1bfa97355243f5e77637f851eba43b656
|
File details
Details for the file shellcolorize-0.3-py3-none-any.whl.
File metadata
- Download URL: shellcolorize-0.3-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6245e0492d5a1ed77d5ffb5a776070af18327e8236b5de3e769f4c9331900c9
|
|
| MD5 |
d32e9276c8adb316e16609e4a8fbbd9d
|
|
| BLAKE2b-256 |
a910546101281e86ac61c6082058cc3c9fea66959c703a6cf941fea88a9a918c
|