Skip to main content

Colorful, styled terminal output with ASCII banners and emoji support

Project description

🎨 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 (box and banner styles)
  • 💬 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. 🔥

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

termcolorxcore-0.1.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

termcolorxcore-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file termcolorxcore-0.1.1.tar.gz.

File metadata

  • Download URL: termcolorxcore-0.1.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for termcolorxcore-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f0f198c22f62c966e31168cbab247a38229a4ab0e2c8d5224cdd54e82e3501b1
MD5 fee7451d4de3aa819b7066e8621fecfe
BLAKE2b-256 8d847830df8e041eea2e329b31e641b68e6dfa7b31e6cd7b445f428fc1fef770

See more details on using hashes here.

File details

Details for the file termcolorxcore-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: termcolorxcore-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for termcolorxcore-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a412f5d9385200bacc3f064e94fd10638d40af256617acf55e4d599be41545d
MD5 92f0ce2301f33a197e331690774343f0
BLAKE2b-256 68e73a407b0db1a79545e05ac8194ad179a9ee9062537540f3bf703d7483d9b7

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