Skip to main content

A lightweight, zero-dependency ANSI color library for terminal output — no bloat, just colors

Project description

color-kiss — A lightweight, zero-dependency ANSI color library for terminal output

Python PyPI License Platform

No bloat, no dependencies — just ANSI escape codes and helper functions. Uses only Python's built-in string formatting.

✨ Features

  • Zero Dependencies — Uses only Python standard library
  • Full ANSI Spectrum — 8 regular + 8 bright foreground & background colors
  • Text Styles — Bold, dim, italic, underline, blink, reverse, hidden, strikethrough
  • Severity Helperserror(), success(), warning(), info() with colored prefixes
  • Auto-reset Helperstyled() applies styles and resets automatically
  • Convenience AliasesGRAY and BG_GRAY for readability

🚀 Quick Start

Installation

pip install color-kiss        # pip
uv pip install color-kiss     # uv
pipx install color-kiss       # pipx

Usage

from color_kiss import styled, BOLD, RED, GREEN, error, success

# Manual color codes
print(f"{RED}Error:{RESET} Something went wrong")

# Auto-reset helper
print(styled("Hello, World!", BOLD, GREEN))

# Severity helpers
print(error("File not found"))
print(success("Download complete"))

📋 Reference

Text Styles

Code Effect
BOLD Bold text
DIM Dim text
ITALIC Italic text
UNDERLINE Underlined text
BLINK Blinking text
REVERSE Swapped fg/bg
HIDDEN Hidden text
STRIKETHROUGH Strikethrough text

Foreground Colors

Code Preview
BLACK, RED, GREEN Regular colors
YELLOW, BLUE, MAGENTA Regular colors
CYAN, WHITE Regular colors
BRIGHT_BLACKBRIGHT_WHITE Bright colors
GRAY BRIGHT_BLACK

Background Colors

Code Preview
BG_BLACKBG_WHITE Regular backgrounds
BG_BRIGHT_BLACKBG_BRIGHT_WHITE Bright backgrounds
BG_GRAY BG_BRIGHT_BLACK

Helper Functions

Function Description
styled(text, *styles) Apply styles to text, auto-append RESET
error(text) Error: {text} in red
success(text) Success: {text} in green
warning(text) Warning: {text} in yellow
info(text) Info: {text} in cyan

Severity Prefixes

Prefix Value
ERROR_PREFIX Error: in red
SUCCESS_PREFIX Success: in green
WARNING_PREFIX Warning: in yellow
INFO_PREFIX Info: in cyan

📖 Examples

from color_kiss import styled, BOLD, RED, GREEN, YELLOW, BG_YELLOW, BLACK, error, success

# Status messages
print(error("Connection refused"))
print(success("Server started on port 8080"))

# Highlighted warnings
print(styled(" WARNING: Unsaved changes! ", BG_YELLOW, BLACK, BOLD))

# Logging
def log(level, msg):
    colors = {"ERROR": (RED,), "WARN": (YELLOW,), "INFO": (GREEN,)}
    print(styled(f"[{level}]", *colors.get(level, ())), msg)

🔧 Requirements

Python 3.0+ — no external dependencies.

❓ FAQ

Why another color library?

color-kiss is zero bytes beyond Python's stdlib — just string constants. Unlike rich (10+ deps) or colorama (Windows compat layer), it does one thing: ANSI escape codes.

Does this work on Windows?

Yes, on Windows Terminal, PowerShell 5.1+, ConEmu, and cmd.exe (Windows 10+). For legacy Windows, enable VT100 with os.system('').

What about 24-bit True Color?

Sticks to 16 standard ANSI colors (32 with backgrounds) supported by virtually all terminals. For 24-bit, use raw escapes: \033[38;2;255;100;0m.

📁 Project Structure

color-kiss/
├── color_kiss/
│   ├── __init__.py      # ANSI constants
│   └── utils.py         # Helpers: styled(), error(), success(), etc.
├── pyproject.toml
├── README.md
└── LICENSE

📄 License

MIT License — see LICENSE file.


Author: Fkernel653 Repository: github.com/Fkernel653/color-kiss PyPI: pypi.org/project/color-kiss

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

color_kiss-0.1.7.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

color_kiss-0.1.7-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file color_kiss-0.1.7.tar.gz.

File metadata

  • Download URL: color_kiss-0.1.7.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.15.0b1

File hashes

Hashes for color_kiss-0.1.7.tar.gz
Algorithm Hash digest
SHA256 824a7bd9c82184b0bb86e5cc7d905005f24f5a87e3953bffb34e4ac99364f83c
MD5 5f2f38cffdc982a89da74d84294d5968
BLAKE2b-256 cda6eb68b4b8a5ad783ad273954bebd1d191968cabe9fe0969f73677cea54eeb

See more details on using hashes here.

File details

Details for the file color_kiss-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: color_kiss-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.15.0b1

File hashes

Hashes for color_kiss-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fa7412e2d60b011adad35f6d94b2c407b1a57cd30ea0ebc9d41e9cba83f3ff2e
MD5 903aa6d9326a02e123090352b0966c2b
BLAKE2b-256 64bcc95037f5cde961a1e50f82c4fd906d60a24ea54416f78db089268580766d

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