clicolors

A simple Python module to colorize your Linux terminal


License
MIT
Install
pip install clicolors==0.2

Documentation

##clicolors - Command Line Interface::Colors ###Simply Python module to colorize your Linux terminal.

Usage:

from clicolors import colorize

# example 1
print colorize('Example text 1', fg='blue',bg='red',attr='bold')

alt text

# example 2
print colorize('Example text 2', 'blue','red','bold')

alt text

# example 3
print colorize('Example text 3', fg='yellow')

alt text

# example 4
print colorize('Example text 4', 'yellow')

alt text

# example 5
print colorize('Example text 5', bg='green')

alt text

# example 6
print colorize('Example text 6',attr='underline')

alt text

# example 7
print colorize('Example text 6',bg='cyan',attr='underline',fg='black')

alt text

# clicolors Demo
from clicolors import colorize, COLORS, ATTRIBUTES

print colorize('clicolors : Lightweight Python script for styling strings in your Linux terminal',fg='black',bg='white',attr='underline')
print ('Foreground: '+' '.join([colorize(color, fg=color) for color in COLORS]))
print ('Background: '+' '.join([colorize(color, bg=color) for color in COLORS]))
print ('Attributes: '+' '.join([colorize(attributes, attr=attributes) for attributes in ATTRIBUTES]))

alt text