🎨 termcolorx
termcolorx is a lightweight, dependency-free Python library for stylish terminal output - with full support for colors, text styles, emoji icons, and ASCII banners/boxes.
It’s designed for developers who want readable, expressive CLI applications that pop with color and energy 💥
🚀 Features
- ✅ ANSI color support on Windows, macOS, and Linux
- 💡 Automatically enables VT Processing on Windows
- 🔤 Text styles: bold, italic, underline, blink, reverse, dim, hidden
- 🧱 ASCII art helpers (
boxandbannerstyles) - 💬 Semantic printing helpers:
success(),warning(),error(),info() - 🎭 Emoji support in all messages
- 🧪 Simple API - no dependencies, no setup
- 💻 Works with any standard Python console or terminal emulator
📦 Installation
You can install it directly from source or package it into a local module:
pip install termcolorxcore
Or if you’re developing locally:
git clone https://github.com/Luka12-dev/termcolorx.git
cd termcolorx
python setup.py install
⚙️ Basic Usage
from termcolorxcore import colored, success, warning, error, info
print(colored("Hello world!", color="cyan", styles=["bold", "underline"]))
success("Operation completed successfully!")
warning("Low disk space detected.")
error("Failed to connect to server.")
info("System update available.")
🌈 Advanced Examples
- 🧠 Custom color and emoji
from termcolorxcore import custom
custom("User added successfully!", color="bright_green", emoji="🟢")
custom("Custom message", color=95, styles=["bold", "underline"], emoji="✨")
🧱 ASCII box and banner
from termcolorxcore import success, error
success("Installation Complete", ascii=True)
error("Fatal Error: Missing Dependency", ascii="banner")
Output example:
+------------------------+
| Installation Complete |
+------------------------+
OR
FATAL ERROR: MISSING DEPENDENCY
================================
🎯 Input Helpers
- Colored prompts
from termcolorxcore import input_colored, confirm
name = input_colored("Enter your name: ", color="cyan", styles=["bold"])
confirmed = confirm("Are you sure?", default=True)
Confirmation dialog
-
Returns True for y, yes, 1, true
-
Returns False for n, no, 0, false
-
Returns the default if input is empty
🧩 Function Reference
Function Description
- colored(text, color, styles, emoji) Returns a styled string
- success(msg, ...) Prints green success message
- warning(msg, ...) Prints yellow warning message
- error(msg, ...) Prints red error message
- info(msg, ...) Prints blue info message
- custom(msg, color, styles, emoji, ...) Fully customizable print helper
- input_colored(prompt, color, styles, emoji) Colored input prompt
- confirm(prompt, default, ...) Yes/no confirmation input
- asciiize(text, style) ASCII box/banner rendering
- example_palette() Returns a string showing all colors
- supports_color() Checks if the terminal supports ANSI colors
🎨 Example Palette
from termcolorxcore import example_palette
print(example_palette())
Output:
black red green yellow blue magenta cyan white
bright_red bright_green bright_yellow bright_blue bright_magenta bright_cyan bright_white
🧠 Notes
-
Colors and styles are combined via ANSI escape sequences.
-
On Windows, VT codes are automatically enabled via ctypes.
-
If your terminal does not support color, the library falls back gracefully to plain text.
📄 License
MIT License © 2025 Luka Free to use, modify, and distribute with attribution.
💪 Motivation
CLI tools don’t have to be boring. With termcolorx, you can make every log, warning, and success message feel alive. Color isn’t just decoration - it’s clarity, confidence, and communication. 🔥
Metadata
Release files for termcolorxcore 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| termcolorxcore-0.1.1.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| termcolorxcore-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.7 kB
Release files / termcolorxcore-0.1.1.tar.gz
| Download URL | termcolorxcore-0.1.1.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0f198c22f62c966e31168cbab247a38229a4ab0e2c8d5224cdd54e82e3501b1
|
|
BLAKE2b-256 checksum How to use checksums |
8d847830df8e041eea2e329b31e641b68e6dfa7b31e6cd7b445f428fc1fef770
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / termcolorxcore-0.1.1-py3-none-any.whl
| Download URL | termcolorxcore-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a412f5d9385200bacc3f064e94fd10638d40af256617acf55e4d599be41545d
|
|
BLAKE2b-256 checksum How to use checksums |
68e73a407b0db1a79545e05ac8194ad179a9ee9062537540f3bf703d7483d9b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|