🌈 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
File details
Details for the file style-1.1.6.tar.gz
.
File metadata
- Download URL: style-1.1.6.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0ad01f3688b83e7fcbb305123df26f7018adf41babe2c12e4b9a68d4e598eb5 |
|
MD5 | 9f60530598a417850445ffbad7e5006a |
|
BLAKE2b-256 | c0376e922b8b02286383d01ca8535bf615adc7ba32120f06e8c4e48f149b6b2a |
File details
Details for the file style-1.1.6-py2.py3-none-any.whl
.
File metadata
- Download URL: style-1.1.6-py2.py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48deb552717e4a38e607e5c667b89f07f4eca5bce94dbaabb66707bf395a2eb6 |
|
MD5 | 986dcb5f1e8f1a7032a2de8f49ee4379 |
|
BLAKE2b-256 | 2006ba0ecadb5d0d7b25505dc650c5c454c5448165b01e04ac4f207816623b8c |