Skip to main content

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

Release files for pastel 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pastel 0.2.1
File Size Uploaded
pastel-0.2.1.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pastel 0.2.1
File Interpreter ABI Platform
pastel-0.2.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 13.5 kB

Release files / pastel-0.2.1.tar.gz

Download URL pastel-0.2.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e6581ac04e973cac858828c6202c1e1e81fee1dc7de7683f3e1ffe0bfd8a573d
BLAKE2b-256 checksum
How to use checksums
76f14594f5e0fcddb6953e5b8fe00da8c317b8b41b547e2b3ae2da7512943c62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.0b2 CPython/3.8.5 Darwin/20.1.0

Release files / pastel-0.2.1-py2.py3-none-any.whl

Download URL pastel-0.2.1-py2.py3-none-any.whl
Size 6.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4349225fcdf6c2bb34d483e523475de5bb04a5c10ef711263452cb37d7dd4364
BLAKE2b-256 checksum
How to use checksums
aa18a8444036c6dd65ba3624c63b734d3ba95ba63ace513078e1580590075d21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.0b2 CPython/3.8.5 Darwin/20.1.0

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page