style is a simple terminal string styling library. Its API is a port of the popular chalk module for javascript.
Install
$ pip install style
Usage
import style
print(style.red.bold('Hello 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.
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 |
||
|---|---|---|---|---|
|
|
|
|
|
Metadata
Release files for style 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| style-1.0.4.tar.gz | 2.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| style-1.0.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 7.7 kB
Release files / style-1.0.4.tar.gz
| Download URL | style-1.0.4.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d8979d9f48802cf8fd7fa7702207b8487328f374a1c6c91eb00683f8826c0d12
|
|
BLAKE2b-256 checksum How to use checksums |
ba8ee045f8142c58dab9b70a9500ca70321145ec6bf02d37ae6e1d8b55b95815
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / style-1.0.4-py2.py3-none-any.whl
| Download URL | style-1.0.4-py2.py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
2afc8ce245d76b8e1a6486adb125436f62cfd59690023c5b7bb7d5715fb36d8f
|
|
BLAKE2b-256 checksum How to use checksums |
9998ba5ecba2a0a8bb77888f0d962d7e6d22dcd5569f79a0c7119002acc7c61c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |