Skip to main content

Examples

import sys
from termcolor_enum import *

text = colored('Hello, World!', Colors.RED, attrs=[Attributes.REVERSE, Attributes.BLINK])
print(text)
cprint('Hello, World!', 'green', Highlights.ON_RED)

print_red_on_cyan = lambda x: cprint(x, 'red', 'on_cyan')
print_red_on_cyan('Hello, World!')
print_red_on_cyan('Hello, Universe!')

for i in range(10):
    cprint(i, 'magenta', end=' ')

cprint("Attention!", 'red', attrs=['bold'], file=sys.stderr)

Text Colors (termcolor_enum.Colors):

Color String Enum Value
Grey 'grey' GREY
Red 'red' RED
Green 'green' GREEN
Yellow 'yellow' YELLOW
Blue 'blue' BLUE
Magenta 'magenta' MAGENTA
Cyan 'cyan' CYAN
White 'white' WHITE

Text Highlights (termcolor_enum.Highlights):

Highlight String Enum Value
On Grey 'on_grey' ON_GREY
On Red 'on_red' ON_RED
On Green 'on_green' ON_GREEN
On Yellow 'on_yellow' ON_YELLOW
On Blue 'on_blue' ON_BLUE
On Magenta 'on_magenta' ON_MAGENTA
On Cyan 'on_cyan' ON_CYAN
On White 'on_white' ON_WHITE

Text Attributes (termcolor_enum.Attributes):

Attribute String Enum Value
Bold 'bold' BOLD
Dark 'dark' DARK
Underline 'underline' UNDERLINE
Blink 'blink' BLINK
Reverse 'reverse' REVERSE
Concealed 'concealed' CONCEALED

Terminal Compatibility

Terminal Bold Dark Underline Blink Reverse Concealed
xterm yes no yes bold yes yes
linux yes yes bold yes yes no
rxvt yes no yes bold/black yes no
dtterm yes yes yes reverse yes yes
teraterm reverse no yes rev/red yes no
aixterm normal no yes no yes yes
PuTTY color no yes no yes no
Windows no no no no yes no
Cygwin SSH yes no color color color yes
Mac Terminal yes no yes yes yes yes

Metadata

Release files for termcolor-enum 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for termcolor-enum 1.2.0
File Size Uploaded Provenance Actions
termcolor-enum-1.2.0.tar.gz 4.6 kB Without provenance Details for termcolor-enum-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for termcolor-enum 1.2.0
File Interpreter ABI Platform Actions
termcolor_enum-1.2.0-py3-none-any.whl Python 3 none any Details for termcolor_enum-1.2.0-py3-none-any.whl

Total release size: 9.9 kB

Release files / termcolor-enum-1.2.0.tar.gz

Download URL termcolor-enum-1.2.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ad7663f75e771bf5e6092d64d4773c067ebebef340aa3527020a2b30459e9e0a
BLAKE2b-256 checksum
How to use checksums
bdadf3c9b9b6dd7fc5e8f2c096a415f1160d53dc75e693189c336b86fe1ee71c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.7 Linux/5.10.79-1-MANJARO

Release files / termcolor_enum-1.2.0-py3-none-any.whl

Download URL termcolor_enum-1.2.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e855f12deae504f3f4c1db6b7f3ec9b42086ec6c78377d6930d9be5380574d5e
BLAKE2b-256 checksum
How to use checksums
97745ed522ebe55a525678519a3005a63c913ae4cae3ae6a861ce23ecc8bf0f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.7 Linux/5.10.79-1-MANJARO

Security for termcolor-enum 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files No provenance

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