Skip to main content

Simple ANSI terminal text coloring

Project description

Chalky

Supported Versions Test Status Documentation Status Codecov Code Style: Black

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")

Basic Colors

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")

Style Colors

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")

True 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")

Configure

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.3.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

chalky-0.3.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file chalky-0.3.0.tar.gz.

File metadata

  • Download URL: chalky-0.3.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.6 Darwin/18.7.0

File hashes

Hashes for chalky-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4cdb76bebb4a8ba12ebb5047be34c343bda853e2674f95feec879a6e1e1de0d1
MD5 d0cf2357619c324e6235bf839463aafb
BLAKE2b-256 179a1dac8874d50357475f86e43bf65d38e6899ecb5d2eed47b0a3e7117eda24

See more details on using hashes here.

File details

Details for the file chalky-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: chalky-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.6 Darwin/18.7.0

File hashes

Hashes for chalky-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e07ae717066d9eea6279383e2cafc9af09602e01aa345ee7d8a3ba6a1e74091
MD5 ca780e5e05b0ae90c3b6067c96e8deca
BLAKE2b-256 515b35cad7176de290d4a73d0aa98c8b4844e67e082b8a85310bf3d44af69706

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page