Metadata-Version: 2.4
Name: color-kiss
Version: 0.1.7
Summary: A lightweight, zero-dependency ANSI color library for terminal output — no bloat, just colors
Author: Fkernel653
License-Expression: MIT
Project-URL: Homepage, https://github.com/Fkernel653/color-kiss
Project-URL: Repository, https://github.com/Fkernel653/color-kiss.git
Project-URL: Documentation, https://github.com/Fkernel653/color-kiss#readme
Keywords: ansi,color,terminal,console,lightweight
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.1
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Terminals
Requires-Python: >=3.0
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

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

[![Python](https://img.shields.io/badge/python-3.0+-blue.svg)](https://python.org)
[![PyPI](https://img.shields.io/pypi/v/color-kiss.svg)](https://pypi.org/project/color-kiss/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Platform](https://img.shields.io/badge/platform-linux%20%7C%20macOS%20%7C%20windows-lightgrey)]()

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 Helpers** — `error()`, `success()`, `warning()`, `info()` with colored prefixes
- **Auto-reset Helper** — `styled()` applies styles and resets automatically
- **Convenience Aliases** — `GRAY` and `BG_GRAY` for readability

## 🚀 Quick Start

### Installation

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

### Usage

```python
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_BLACK`–`BRIGHT_WHITE` | Bright colors |
| `GRAY` | → `BRIGHT_BLACK` |

### Background Colors

| Code | Preview |
|------|---------|
| `BG_BLACK`–`BG_WHITE` | Regular backgrounds |
| `BG_BRIGHT_BLACK`–`BG_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

```python
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](LICENSE) file.

---

**Author:** [Fkernel653](https://github.com/Fkernel653)
**Repository:** [github.com/Fkernel653/color-kiss](https://github.com/Fkernel653/color-kiss)
**PyPI:** [pypi.org/project/color-kiss](https://pypi.org/project/color-kiss/)
