pretty text for command line


Keywords
pretty, ansi, ansi-color, rgb, hsl, hue, saturation, lightness, hex, dye, colorant, pigment, list, array, vector, matrix, 1d-list, 2d-list, entry, entries, key-value, pair
License
MIT
Install
pip install palett==0.0.18

Documentation

texting

misc for string

Functions

  • has_ansi
  • lange
  • pad: lpad, mpad, rpad
  • str_value

Usage

from texting.has_ansi import has_ansi
from texting.lange import lange
words = [
    'peace',
    '\u001B[4mwar\u001B[0m',
    '\u001b[38;2;255;255;85mtolstoy\u001b[0m',
]

for word in words:
    print(f'[{word}] [has_ansi] ({has_ansi(word)}) [lange] ({lange(word)})')