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 termcolorx

Or if you’re developing locally:

git clone https://github.com/Luka12-dev/termcolorx.git
cd termcolorx
python setup.py install

⚙️ Basic Usage

from termcolorx 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 termcolorx import custom

custom("User added successfully!", color="bright_green", emoji="🟢")
custom("Custom message", color=95, styles=["bold", "underline"], emoji="✨")

🧱 ASCII box and banner

from termcolorx 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 termcolorx 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 termcolorx 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.0.tar.gz (3.3 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.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: termcolorxcore-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 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.0.tar.gz
Algorithm Hash digest
SHA256 12e8f87116ba9c36335f067b474830c191f1f9927b35cf205eaf1776ea4c5506
MD5 ac2bdcfc5d4c53c05db538aa7a80d01c
BLAKE2b-256 1df7d1226dc95e46162e0748b2c673bd3dab634a9a3cd4923851614259dde413

See more details on using hashes here.

File details

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

File metadata

  • Download URL: termcolorxcore-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f64a788ca7512e9bd5bdf5b744b3491a13cb3dfc5dc49008cb02257c5737925b
MD5 b0f3169cf3977b25970b598f0293f520
BLAKE2b-256 2fc75f5c1a053660a09ee76b3507ebb06fb0be99622223b5f1fd519f37261a62

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