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.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

pastel-0.1.1-py2.py3-none-any.whl (5.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pastel-0.1.1.tar.gz.

File metadata

  • Download URL: pastel-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0a5 CPython/3.7.4 Darwin/18.7.0

File hashes

Hashes for pastel-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bf3b1901b2442ea0d8ab9a390594e5b0c9584709d543a3113506fe8b28cbace3
MD5 f0ad6c87ca8748343cb1980e23458dac
BLAKE2b-256 88f4848a64c39b19d421b28467d799768860eb19add127ac8eafafafb9e90998

See more details on using hashes here.

File details

Details for the file pastel-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: pastel-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0a5 CPython/3.7.4 Darwin/18.7.0

File hashes

Hashes for pastel-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a904e1659512cc9880a028f66de77cc813a4c32f7ceb68725cbc8afad57ef7ef
MD5 3b7187329bca9669c684a9bfe92095ed
BLAKE2b-256 09b9ca6434777928cc4e25cd17a8d2a913f3c2877ce54c5a7b7c18bf646ff257

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page