Simple ANSI terminal text coloring
Project description
Simple ANSI terminal text coloring
Yet another terminal text coloring library…
Why? Because, I like certain things and I hate certain things about the currently available solutions. This here is my attempt to build an interface for simply applying ANSI escape sequences to strings that I enjoy and can update at my own free will. That is it, there is nothing new or interesting that this packages adds. Thanks 🎉
For more interesting details, please visit the documentation.
Style Composition
from chalky import sty, fg
my_style = sty.bold & fg.red
print(my_style | "This is red on black")
print(my_style.reverse | "This is black on red")
Style Chaining
from chalky import chain
print(chain.bold.green | "I'm bold green text")
print(chain.white.bg.red.italic | "I'm italic white text on a red background")
Truecolor
from chalky import rgb, sty, hex
print(rgb(23, 255, 122) & sty.italic | "Truecolor as well")
print(sty.bold & hex("#ff02ff") | "More and more colors")
Disable Colors
from chalky import configure, fg
print(fg.red | "I am red text")
configure(disable=True)
print(fg.red | "I am NOT red text")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chalky-0.4.0.tar.gz
(18.2 kB
view details)
Built Distribution
chalky-0.4.0-py3-none-any.whl
(25.8 kB
view details)
File details
Details for the file chalky-0.4.0.tar.gz
.
File metadata
- Download URL: chalky-0.4.0.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/4.19.128-microsoft-standard
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea4b7acce7b61c7347c8ea5e7ac1d6e267aa71ad3570e3877fe38113c663d805 |
|
MD5 | eb0a0ef8a45775c946e331648703015f |
|
BLAKE2b-256 | 896f1cee8190580301c4906ece3abfc1dcae06fdc0d7bf95ee20a887558e0bda |
File details
Details for the file chalky-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: chalky-0.4.0-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.6 Linux/4.19.128-microsoft-standard
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54753c0bd8322e37d7b50e5cb262ec87089255343e5e13f8311af23eab64bec0 |
|
MD5 | c2e01d2f59c43c808fd6aef6b11f0ca7 |
|
BLAKE2b-256 | 0b34e55d9f4db7d6342e4569091f5768b1ed87e91bff9386131d504e17018246 |