Skip to content
/ pastel Public
forked from sdispater/pastel

Bring colors to your terminal

License

Notifications You must be signed in to change notification settings

abn/pastel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pastel: Bring colors to your terminal

Pastel is a simple library to help you colorize strings in your terminal.

It comes bundled with predefined styles:

  • info: green
  • comment: yellow
  • question: black on cyan
  • error: white on red

https://raw.githubusercontent.com/sdispater/pastel/master/assets/screenshot.png

Features

  • Use predefined styles or add you own.
  • Disable colors all together by calling with_colors(False).
  • Automatically disables colors if the output is not a TTY.
  • Used in cleo.
  • Supports Python 2.7+, 3.5+ and PyPy.

Usage

>>> import pastel
>>> print(pastel.colorize('<info>Information</info>'))
'Information'  # Green string by default
>>> print(pastel.colorize('<fg=red;options=bold>This is bold red</>'))
'This is bold red'

Installation

pip install pastel

About

Bring colors to your terminal

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%