Skip to main content

I am an upgraded version of termcolor that allows you to store colors as objects and use addition/calling to apply them to text. Color objects can also validate whether you use the correct color identifiers upon creation, so all errors can be caught early.

Example

import sys
from colorie import Color, colored, cprint

text = colored('Hello, World!', 'red', attrs=['reverse', 'blink'])
print(text)
cprint('Hello, World!', 'green', 'on_red')

RED_ON_CYAN = Color('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)

RED = Color('red')
ON_WHITE = Color(highlight='on_white')
RED_ON_WHITE = RED + ON_WHITE
print(RED + "I am red" + " and I am red!")
print(RED + "I am red on white!" + ON_WHITE)

Installation

pip install colorie

Text Properties

  • Text colors

    • grey
    • red
    • green
    • yellow
    • blue
    • magenta
    • cyan
    • white
  • Text highlights

    • on_grey
    • on_red
    • on_green
    • on_yellow
    • on_blue
    • on_magenta
    • on_cyan
    • on_white
  • Attributes

    • bold
    • dark
    • underline
    • blink
    • reverse
    • concealed

Terminal properties

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 colorie 0.1.2

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

Source distribution (sdist)

Source distribution for colorie 0.1.2
File Size Uploaded
colorie-0.1.2.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for colorie 0.1.2
File Interpreter ABI Platform
colorie-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / colorie-0.1.2.tar.gz

Download URL colorie-0.1.2.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
973d0a039d5c8f7a230b776265cad25ec8552ab4ed67d86cd457527544dd3f19
BLAKE2b-256 checksum
How to use checksums
6da2c367bbc8a924a01a93f40c4f62d886a879a40774240b41c24ca518238eb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.7.9 Windows/10

Release files / colorie-0.1.2-py3-none-any.whl

Download URL colorie-0.1.2-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd3c1ded062d11fc284557105aa9799e49e7ec1655cdd49af2e52dc1671fe0cd
BLAKE2b-256 checksum
How to use checksums
410b68a2d5ff36d265da32208951f2797e67c7aea4b1e1950099ce4c4c7f68d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.7.9 Windows/10

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

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