Skip to main content

Stylized terminal alerts for Python

Project description

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

[ ERROR ] !!! Something went wrong
[ SUCCESS ] +++ Operation completed successfully
[ WARN ] !?! Be careful with this step
[ TIP ] >>> You can reuse this function later
[ DEBUG ] ::: x = 10
[ INFO ] --- Process started

Color Palette

The library uses ANSI escape sequences to apply colors in supported terminals.

Alert Type Label Marker Color
Error ERROR !!! Red
Success SUCCESS +++ Green
Warn WARN !?! Yellow
Tip TIP >>> Cyan
Debug DEBUG ::: Magenta
Info INFO --- Blue

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()

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.

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

kalerts-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

kalerts-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file kalerts-0.1.0.tar.gz.

File metadata

  • Download URL: kalerts-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for kalerts-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d1a50b0c8df58bf7a009f0c21ef151d71a0ec7177ef0029216bd152c18708859
MD5 71018d443841c24e5df7e04fa96b5b1b
BLAKE2b-256 b1a736d37873b997cf3dd88b57a8a4dd53483df54349d3fe1c7873d458cc9bd2

See more details on using hashes here.

File details

Details for the file kalerts-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kalerts-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for kalerts-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b78c3660572842d27e268cba59596c77dc2b6e308018732f07fe55d22a20240d
MD5 bd20225a2b9389becfe7654aeb2b3ca4
BLAKE2b-256 9ac58384b618f5434dcc0e1cd71b9f1cc5427bd5ed06f14ed4bf15cc06c82546

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