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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file sgr-ansi-0.0.5.tar.gz.

File metadata

  • Download URL: sgr-ansi-0.0.5.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for sgr-ansi-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d691f23151829c7af505a02928199cf61ff34fc94f2ae4c206061303e90b62d1
MD5 8ac4649a3cceded081bd8b15864db35a
BLAKE2b-256 cb5aef8487fa24d36c05ddaee5977540a584e2ac9f36de268cdc4601be76ae80

See more details on using hashes here.

File details

Details for the file sgr_ansi-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: sgr_ansi-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for sgr_ansi-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f479a518f542673cb6edfb9fe8924dc2b1b32b3b70de51ac890c9b6152e9e637
MD5 5ede86b94e4cf7074b1ee3fad9fb56ec
BLAKE2b-256 87cbc5f24030dad7e9c5a03a26727c49735b7be4b9ae724e0d96d67d4884777a

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