🌈 Terminal string styling
Project description
style is a simple terminal string styling package. Its API is a port of the popular chalk package for javascript.
Install
$ pip install style
Usage
import style
print(style.red('Hello', style.bold('world') + '!'))
API
style.style*[.style](*objects, sep=' ')
Chain styles and call the last one as a method with an argument. Order doesn’t matter, and later styles take precedence in case of a conflict, e.g. style.red.yellow.green is equivalent to style.green. Styles can be nested.
Multiple arguments will be separated by sep, a space by default.
style.enabled
Color support is automatically detected, but can also be changed manually.
set style.enabled to True or False
use the command line parameter --color or --no-color
Styles
Modifiers |
Colors |
Background colors |
||
---|---|---|---|---|
|
|
|
|
|
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
Hashes for style-1.1.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48deb552717e4a38e607e5c667b89f07f4eca5bce94dbaabb66707bf395a2eb6 |
|
MD5 | 986dcb5f1e8f1a7032a2de8f49ee4379 |
|
BLAKE2b-256 | 2006ba0ecadb5d0d7b25505dc650c5c454c5448165b01e04ac4f207816623b8c |