Skip to main content

🌈 Terminal string styling

Project description

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

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

style-1.1.6.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

style-1.1.6-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2 Python 3

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

Hashes for style-1.1.6.tar.gz
Algorithm Hash digest
SHA256 d0ad01f3688b83e7fcbb305123df26f7018adf41babe2c12e4b9a68d4e598eb5
MD5 9f60530598a417850445ffbad7e5006a
BLAKE2b-256 c0376e922b8b02286383d01ca8535bf615adc7ba32120f06e8c4e48f149b6b2a

See more details on using hashes here.

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

Hashes for style-1.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 48deb552717e4a38e607e5c667b89f07f4eca5bce94dbaabb66707bf395a2eb6
MD5 986dcb5f1e8f1a7032a2de8f49ee4379
BLAKE2b-256 2006ba0ecadb5d0d7b25505dc650c5c454c5448165b01e04ac4f207816623b8c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page