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.6.tar.gz (5.2 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.6-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: color_kiss-0.1.6.tar.gz
  • Upload date:
  • Size: 5.2 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.6.tar.gz
Algorithm Hash digest
SHA256 678a3596904c8eedea3ec842fe7dbd946da47b4531e59209597134fc365b9fb5
MD5 e00018dcb40742173910049ef94b31d5
BLAKE2b-256 3314508ea0a9bb8dd8ac53aba13ffa41dc221429600a302f044a9a9ca4ef5b10

See more details on using hashes here.

File details

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

File metadata

  • Download URL: color_kiss-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 91f4dedfe91a73d47b7b14814a5231b3d7c0a95cd80748d0a314469a4704b691
MD5 b24791fa7a57e50004915f1ed63b9fce
BLAKE2b-256 e074a748b0bc370b56c46a58d5dc514ad50a80bed9bebb875b7756ed33757c78

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