Skip to main content

Build Status PyPI version

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

  • 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

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)

Source distribution for style 1.0.4
File Size Uploaded
style-1.0.4.tar.gz 2.9 kB Details

Built distribution (wheel)

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

Release history Release notifications | RSS feed

1.1.6

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

This release

1.0.4 This release

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