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.8.tar.gz (4.6 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.8-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: color_kiss-0.1.8.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for color_kiss-0.1.8.tar.gz
Algorithm Hash digest
SHA256 e194d779fedfea8b0d3ac813e0505d42aaa4d53c4cbcceec75653c30f84150ac
MD5 0940019b7cf39db90c82d45c7d321099
BLAKE2b-256 6b3fb358d49eb6ffc5937540c39c2ffce13dd4c36d5c9dc93c7e7ec61b0efc31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: color_kiss-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for color_kiss-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5f3eead6506edf682317e2abe8df715f48f2494f31e221e55ad41c769e982347
MD5 993ceaa05b5ef15ba1c258e36249fce3
BLAKE2b-256 8cfd0c3ad44450ca4729b99a033d37d7b01fb0870d2f64ecb4a80658d6e4d047

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