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
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)
| File | Size | Uploaded | |
|---|---|---|---|
| pastel-0.2.1.tar.gz | 7.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|