ANSII Color formatting for output in terminal
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file colorie-0.1.2.tar.gz.
File metadata
- Download URL: colorie-0.1.2.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.7.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
973d0a039d5c8f7a230b776265cad25ec8552ab4ed67d86cd457527544dd3f19
|
|
| MD5 |
6f22df9f9e26e4c5287a9318596d2849
|
|
| BLAKE2b-256 |
6da2c367bbc8a924a01a93f40c4f62d886a879a40774240b41c24ca518238eb6
|
File details
Details for the file colorie-0.1.2-py3-none-any.whl.
File metadata
- Download URL: colorie-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.7.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd3c1ded062d11fc284557105aa9799e49e7ec1655cdd49af2e52dc1671fe0cd
|
|
| MD5 |
508733cda63362463f21c61581446664
|
|
| BLAKE2b-256 |
410b68a2d5ff36d265da32208951f2797e67c7aea4b1e1950099ce4c4c7f68d8
|