Skip to main content

kalerts

kalerts is a lightweight Python library for displaying stylized one-line terminal alerts with ANSI colors, clean formatting, and zero external dependencies.

It is designed for developers who want simple, readable console messages such as errors, warnings, debug logs, tips, and success notices — without setting up a full logging framework.

Features

  • One-line alert output
  • ANSI color support
  • Works on Windows, Linux, and macOS
  • No external dependencies
  • Simple API
  • Automatic ANSI enabling on modern Windows terminals
  • Different visual marker for each alert type

Alert Types

kalerts includes the following built-in alert styles:

  • error
  • success
  • warn
  • tip
  • debug
  • info

Each alert type has:

  • its own label
  • its own marker
  • its own terminal color

Installation

pip install kalerts

Quick Start

import kalerts

kalerts.error("Something went wrong")
kalerts.success("Operation completed successfully")
kalerts.warn("Be careful with this step")
kalerts.tip("You can reuse this function later")
kalerts.debug("x = 10")
kalerts.info("Process started")

Output Example

Example

import kalerts

def connect_database():
    kalerts.info("Connecting to database")
    kalerts.success("Database connected")

def validate_user_input(username):
    if not username:
        kalerts.error("Username cannot be empty")
        return

    if len(username) < 3:
        kalerts.warn("Username is very short")

    kalerts.tip("Use a memorable username")
    kalerts.debug(f"Validated username: {username}")

validate_user_input("ab")
connect_database()

Custom Alerts

You can create one-off alerts with a custom label, suffix, and color:

import kalerts

kalerts.custom(
    "test",
    alert="Setting",
    suffix="^^^",
    color="#A855F7",
)

Output:

[ Setting ] ^^^ test

For reusable alerts, create the style once and call it like a normal function:

import kalerts

setting = kalerts.create_alert(
    alert="Setting",
    suffix="^^^",
    color="#A855F7",
)

setting("test")
setting("configuration loaded")

You can also register your own named colors:

import kalerts

kalerts.add_color("roxo", "#A855F7")
setting = kalerts.create_alert("Setting", "^^^", "roxo")
setting("test")

Supported color formats:

  • Registered color name, such as "purple" or "roxo" after add_color()
  • HEX, such as "#A855F7"
  • RGB tuple, such as (168, 85, 247)

How It Works

Each function writes directly to the terminal output, so you do not need to use print().

Example:

import kalerts

kalerts.error("File not found")

Not:

print(kalerts.error("File not found"))

Compatibility

kalerts is compatible with:

  • Python 3.8+
  • Windows
  • Linux
  • macOS

On Windows, the library attempts to enable ANSI escape support automatically using the built-in ctypes module.

Philosophy

kalerts focuses on simplicity:

  • no configuration files
  • no external dependencies
  • no complex logger setup
  • just readable and colorful terminal alerts

License

This project is licensed under the MIT License.

Metadata

Release files for kalerts 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kalerts 0.2.0
File Size Uploaded
kalerts-0.2.0.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kalerts 0.2.0
File Interpreter ABI Platform
kalerts-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / kalerts-0.2.0.tar.gz

Download URL kalerts-0.2.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
90031a21e07a70da5d1cc7873fd3c47901eb9e303c296758b833b5d2c0d85986
BLAKE2b-256 checksum
How to use checksums
50666665cbd898900f005442a08395fd7ccc22792e755434ba46e51c9fc963af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / kalerts-0.2.0-py3-none-any.whl

Download URL kalerts-0.2.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dfa063de184c2a42aeb97290b5cc666dc50148b0ae54b1a805c69fa95924962
BLAKE2b-256 checksum
How to use checksums
beacb46fb805048a01aebd02cdce6fe613ca7720406adddabaebfcdc4ff5d3b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page