Skip to main content

CLI utilities with ANSI colors, Rich support and a flexible logger

Project description

clistack

Librería ligera para herramientas CLI en Python con:

  • Colores ANSI (sin dependencias)

  • Soporte opcional para Rich

  • Logger con:

    • niveles (INFO, OK, WARN, ERROR, DEBUG)
    • logs a archivo
    • rotación diaria
    • spinner
    • barra de progreso

📦 Instalación

Básico (sin Rich)

pip install clistack

Con Rich (recomendado)

pip install clistack[rich]

🚀 Uso rápido

from clistack.logger import Logger
from clistack.ansi import success, error
from clistack.rich_utils import print_color
from clistack.rich_colors import RichColor

# ANSI
success("Todo OK")
error("Algo falló")

# Rich (si está instalado)
print_color("Texto con estilo", RichColor.BRIGHT_CYAN, bold=True)

# Logger
log = Logger(
    log_to_file=True,
    log_path="logs/",   # carpeta → logs por día
    debug=True
)

log.info("Iniciando proceso")
log.debug("Debug activado")
log.success("Operación exitosa")
log.warning("Advertencia")
log.error("Error detectado")

# Spinner
log.spinner("Cargando...", duration=2)

# Progress bar
import time
for _ in log.progress(range(5), desc="Procesando"):
    time.sleep(0.3)

log.success("Finalizado")

📁 Logs

Si usás:

Logger(log_to_file=True, log_path="logs/")

Se generan archivos automáticamente:

logs/
├── 2026-04-20.log
├── 2026-04-21.log

También podés usar un archivo fijo:

Logger(log_to_file=True, log_path="logs/app.log")

⚙️ Características

  • Funciona sin dependencias externas
  • Usa Rich automáticamente si está disponible
  • Fallback a ANSI si no está instalado
  • Ideal para scripts, tools CLI y automatización

🧠 Notas

  • Rich es opcional, no rompe si no está instalado
  • Compatible con PyInstaller
  • Pensado para tools / scripting / pentesting / automatización

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

clistack-0.1.1.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.

clistack-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file clistack-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for clistack-0.1.1.tar.gz
Algorithm Hash digest
SHA256 292e81d9353824f74737d4058dca8c0de9a7a672b2bbbff72ba32039d387b2ea
MD5 b3442e26699f999c630021910d96e99c
BLAKE2b-256 1eee3a826eb7a32aa2fdb4766f0b1f4f8dbd21000f713f2eaf4dc75c3a1d7cd9

See more details on using hashes here.

File details

Details for the file clistack-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: clistack-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for clistack-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4127b2d6138da3d872e6cd6e131db9a66d0a36f83add31de2c1756163aca54a9
MD5 1fb337a84a4134f72c303477223fd749
BLAKE2b-256 4d897e7e45242b5906ceabd69f9753b96883275d0c2db7ea35ade41ed2db662b

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