Skip to main content

Bring colors to your terminal.

Project description

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

Project details


Download files

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

Source Distribution

pastel-0.2.1.tar.gz (7.6 kB view hashes)

Uploaded source

Built Distribution

pastel-0.2.1-py2.py3-none-any.whl (6.0 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page