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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| colorie-0.1.2.tar.gz | 5.5 kB | Without provenance | Details for colorie-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| colorie-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for colorie-0.1.2-py3-none-any.whl |
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
|
Security for colorie 0.1.2
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.