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 |
||
|---|---|---|---|---|
|
|
|
|
|
Release files for style 1.1.6
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.1.6.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| style-1.1.6-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 8.7 kB
Release files / style-1.1.6.tar.gz
| Download URL | style-1.1.6.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0ad01f3688b83e7fcbb305123df26f7018adf41babe2c12e4b9a68d4e598eb5
|
|
BLAKE2b-256 checksum How to use checksums |
c0376e922b8b02286383d01ca8535bf615adc7ba32120f06e8c4e48f149b6b2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / style-1.1.6-py2.py3-none-any.whl
| Download URL | style-1.1.6-py2.py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
48deb552717e4a38e607e5c667b89f07f4eca5bce94dbaabb66707bf395a2eb6
|
|
BLAKE2b-256 checksum How to use checksums |
2006ba0ecadb5d0d7b25505dc650c5c454c5448165b01e04ac4f207816623b8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|