Skip to main content

🌈 Terminal string styling

Project description

Build Status PyPI version

clr is a simple terminal string styling library. Its API is a port of the popular chalk module for javascript.

Install

$ pip install clr

Usage

import clr

print(clr.red.bold('Hello world!'))

API

clr.style*[.style](*objects, sep=' ')

Chain styles and call the last one as a method with an argument. Order doesn’t matter, and later styles take precedence in case of a conflict, e.g. clr.red.yellow.green is equivalent to clr.green.

Multiple arguments will be separated by sep, a space by default.

Styles

Modifiers Colors Background colors
  • bold
  • dim
  • italic
  • underline
  • inverse
  • hidden
  • strikethrough
  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • light_black
  • light_red
  • light_green
  • light_yellow
  • light_blue
  • light_magenta
  • light_cyan
  • light_white
  • on_black
  • on_red
  • on_green
  • on_yellow
  • on_blue
  • on_magenta
  • on_cyan
  • on_white
  • on_light_black
  • on_light_red
  • on_light_green
  • on_light_yellow
  • on_light_blue
  • on_light_magenta
  • on_light_cyan
  • on_light_white

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for clr, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size clr-1.0.3-py2.py3-none-any.whl (4.4 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size clr-1.0.3.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page