Skip to main content

awesome ansi8 colorful text interface in terminal

Project description

sgr-ansi

awesome SGR ANSI colorful text interface in terminal

full supported in python3.7+, macosx

awesome colorful text

colorful usage

colorful demo1

colorful demo2

install

pip install sgr-ansi

usage

Beware of two rules:

  • styles require alphabet order
  • styles go before colors

about styles, you can use as many as possible, but colors only the last two will take effect

so like BDISUkrgybmcw, all BDISU will take effect, but for colors only cw: cyan on white will take effect

styles/colors supported

styles

B: bold, D: dimmed, I: italic, S: strike_through, U: underlined

colors

k: black, r: red, g: green, y: yellow b: blue, m: magenta, c: cyan, w: white

import sgr_ansi as echo

echo.BIg()
echo.BIg('I love you 3 thousand times')

chained call

from sgr_ansi import Chain

Chain().BIy('Yep,').BIUb(
    'How do you like this?'
).Bm('\n\t[✔]').BUg('1.').Bg('Y: yes.').Bm('\n\t[✘]').BUr('2.').Br('N: not.').show()

colorful chain

run demo

just run sgransi to check all available styles

# after installed sgr_ansi, cli sgransi is available
sgransi -h

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

sgr-ansi-0.0.5.tar.gz (17.9 kB view hashes)

Uploaded Source

Built Distribution

sgr_ansi-0.0.5-py3-none-any.whl (28.8 kB view hashes)

Uploaded Python 3

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