Skip to main content

Build Status PyPI version

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

  • bold

  • dim

  • italic

  • underline

  • inverse

  • hidden

  • strikethrough

  • black

  • red

  • green

  • yellow

  • blue

  • magenta

  • cyan

  • white

  • light_black

  • light_red

  • light_green

  • light_yellow

  • light_blue

  • light_magenta

  • light_cyan

  • light_white

  • on_black

  • on_red

  • on_green

  • on_yellow

  • on_blue

  • on_magenta

  • on_cyan

  • on_white

  • on_light_black

  • on_light_red

  • on_light_green

  • on_light_yellow

  • on_light_blue

  • on_light_magenta

  • on_light_cyan

  • on_light_white

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)

Source distribution for style 1.1.6
File Size Uploaded
style-1.1.6.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for style 1.1.6
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.1.6 This release

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page