Skip to main content

Basic support for asci color text on linux terminals

Project description

Pryzm, color convenient class for linux/mac cli

Install it

pip install pryzm

Create color 'wrappers' to compose text for printing

import pryzm as pz
red = pz.Pryzm().red                  # create a function for a color
red_on_blue = pz.Pryzm().red().BLUE   # lower case is text, CAPS is background.
                                      # NB: that to chain you need the () to capture the 'self' return

print(red('Red Text') + " " + red_on_blue("followed by blue text"))  # prints red and blue text 

Create standalone functions to print directly by setting echo=True in constructor

import pryzm as pz
red = pz.Pryzm(echo=True).red
red_on_blue = pz.Pryzm(echo=True).red().BLUE

red("This is red text")                               # These two functions now print directly
red_on_blue("This is red text with blue background")

# great for quickly creating semantic printing to better read console output!
warning = pz.Pryzm(echo=True).yellow
info = pz.Pryzm(echo=True).cyan
error = pz.Pryzm(echo=True).red

error("Error: this text shows as red")
warning("Warning: pay attention, but really just an fyi")
info("Cyan is probably a little strong, maybe green would be better")

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pryzm, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size pryzm-0.1.4-py3-none-any.whl (3.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pryzm-0.1.4.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page