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
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 details)
Built Distribution
File details
Details for the file pastel-0.2.1.tar.gz
.
File metadata
- Download URL: pastel-0.2.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.0b2 CPython/3.8.5 Darwin/20.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6581ac04e973cac858828c6202c1e1e81fee1dc7de7683f3e1ffe0bfd8a573d |
|
MD5 | ff5ae4454b56dd7efd5fc99909212ec9 |
|
BLAKE2b-256 | 76f14594f5e0fcddb6953e5b8fe00da8c317b8b41b547e2b3ae2da7512943c62 |
File details
Details for the file pastel-0.2.1-py2.py3-none-any.whl
.
File metadata
- Download URL: pastel-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.0b2 CPython/3.8.5 Darwin/20.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4349225fcdf6c2bb34d483e523475de5bb04a5c10ef711263452cb37d7dd4364 |
|
MD5 | 6e874cfcdbd4bcc288594f805d8c7940 |
|
BLAKE2b-256 | aa18a8444036c6dd65ba3624c63b734d3ba95ba63ace513078e1580590075d21 |