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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
292e81d9353824f74737d4058dca8c0de9a7a672b2bbbff72ba32039d387b2ea
|
|
| MD5 |
b3442e26699f999c630021910d96e99c
|
|
| BLAKE2b-256 |
1eee3a826eb7a32aa2fdb4766f0b1f4f8dbd21000f713f2eaf4dc75c3a1d7cd9
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4127b2d6138da3d872e6cd6e131db9a66d0a36f83add31de2c1756163aca54a9
|
|
| MD5 |
1fb337a84a4134f72c303477223fd749
|
|
| BLAKE2b-256 |
4d897e7e45242b5906ceabd69f9753b96883275d0c2db7ea35ade41ed2db662b
|