color

String colorize module for Python 3.x

Latest version: 0.1 registry icon
Maintenance score
0
Safety score
0
Popularity score
1
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
0.1 0 0 0 0 0

Stability
Latest release:

0.1 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

MIT   -   MIT License

Not a wildcard

Not proprietary

OSI Compliant



color colorize CocoaPods Build Status

String colorize module for Python 3.x

Color chart

chart

Installation

$ pip install color

or

$ easy_install color

or make it

$ python setup.py install

Usage

# -*- coding: utf-8 -*-
#
# You use to specific functions
#
# from color import colorize
# from color import uncolorize

from color import *

# colorize function. set the other code.
print(colorize(38, 5, 197, 'foo bar baz'))

# uncolorize function
print(uncolorize(red('foo')))

# tr function.
print(tr('foo bar baz', 'o', FgColor.Red))      # colorized: 'o' chars.
print(tr('foo bar baz', 'foo', FgColor.Yellow)) # colorized: 'foo' words.

# tr_iter function.
print(tr_iter('foo bar baz', 'oa', FgColor.Green)) # colorized: all of 'o' and 'a' chars.

# cprint function.
cprint('hellooo', base=Base.Bold)
cprint('foo bar', fg=FgColor.Red, file=sys.stderr)
cprint('foo') # Stdout

# OTHERS
r = red('ops!')
g = green('hmmm...')
cprint(r, g)

cprint_yellow('yooo!!!')
cprint_green('success')
cprint_black('cocoa bitter')

# ...

Credits

License

The MIT License (MIT) - see LICENSE for more details