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

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

Uploaded Source

Built Distribution

pastel-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pastel-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pastel-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3108af417ec0fa6d0a620e676ec4f02c839ca13e10611586e5d2174b46aa0bc3
MD5 d185758e205e0a17cef469463bae3ba4
BLAKE2b-256 bd13a68f2e448b471e8c49e9b596d569ae167a5135ac672b1dc5f24f62f9c15f

See more details on using hashes here.

File details

Details for the file pastel-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pastel-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1fee8079534f99f1805a044fef946d23eee6d6a7cd34292c30e6c16be9a80b9
MD5 5ad0b866dc5cf2e3f246e201eedba030
BLAKE2b-256 9b7e7d701686013c0d7dae62e0977467232a6adc2e562c23878eb3cd4f97d02e

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