TextUI colors for Python.
Project description
This module is really simple, it gives you colored strings for terminal usage. Included colors are red, green, yellow, blue, black, magenta, cyan, white, and normal (as well as clean and disable).
Crayons is nice because it automatically wraps a given string in both the foreground color, as well as returning to the original state after the string is complete. Most terminal color libraries make you manage this yourself.
Arguments include always=True and bold=True.
Features
If you call disable(), all future calls to colors will be ignored.
If you call normal(), color is reset to default foreground color
If the current process is not in a TTY (e.g. being piped), no colors will be displayed.
Length of ColoredStrings can be properly calculated.
Powered by colorama.
Usage is simple
# red is red, white is white. >>> print('{} white'.format(crayons.red('red'))) red white
That’s it!
Installation
$ pip install crayons
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
Built Distribution
File details
Details for the file crayons-0.4.0.tar.gz
.
File metadata
- Download URL: crayons-0.4.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd33b7547800f2cfbd26b38431f9e64b487a7de74a947b0fafc89b45a601813f |
|
MD5 | 88a79c854ce54bcbb8376d18a448d627 |
|
BLAKE2b-256 | b86b12a1dea724c82f1c19f410365d3e25356625b48e8009a7c3c9ec4c42488d |
File details
Details for the file crayons-0.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: crayons-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e73ad105c78935d71fe454dd4b85c5c437ba199294e7ffd3341842bc683654b1 |
|
MD5 | 77656d7fa974e0da626062f045b5ea07 |
|
BLAKE2b-256 | 5b0de3fad4ca1de8e70e06444e7d777a5984261e1db98758b5be3e8296c03fe9 |