YATTS - Yet Another Terminal Text Styler
Styles terminal text
Install
pip install yatts
4-Bit Color Examples
from yatts import style
# Prints yatts with dark green text color
print(style('yatts', ['green', 'dark']))
# Prints yatts with red text color and dark yellow background
print(style('yatts', 'red', ['yellow', 'dark']))
# Prints yatts with white text color, blue background and italic text style
print(style('yatts', bgcolor='blue', italic=True))
# Prints a bold, italic, overlined yatts
print(style('yatts', decorations=['bold', 'italic', 'overline']))
8-Bit Color Examples
from yatts import style
yatts = ' yatts '*10
# Dark green text color
print(style(yatts, 2) + '\n')
# Light red text color with light orange background color
print(style(yatts, 196, 223) + '\n')
# 4-Bit and 8-Bit colors mixed and bold parameter
# combined with decorations parameter
print(style(yatts, 'white', 238, bold=True,
decorations=['underline','overline']))
Add/Remove Examples
from yatts import *
yatts = ' yatts '*10
yatts = style(yatts, 'blue', 235, decorations=['italic', 'underline'])
print(yatts + '\n')
yatts = add(yatts, 'bold')
print(yatts + '\n')
yatts = remove(yatts, ['color', 'underline'])
print(yatts + '\n')
yatts = remove_all(yatts)
print(yatts)
Function Arguments
Style Function
# Styles a text
def style(
text,
color=None,
bgcolor=None,
bold=False,
italic=False,
underline=False,
striketrough=False,
decorations=None
):
All valid strings for decorations:
'bold''blink''italic''overline''underline''striketrough''double_underline'
Add Function
# Adds a specific style to a text
def add(text, style, value=None):
Remove Functions
# Removes one or more specific style from a styled text
def remove(text, style):
# Removes all styles from a styled text
def remove_all(text):
All valid strings for style:
'color''bgcolor''bold''blink''italic''overline''underline''striketrough''double_underline'
4-Bit Color Palette
8-Bit Color Palette
Release files for yatts 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yatts-1.0.0.tar.gz | 149.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yatts-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 154.4 kB
Release files / yatts-1.0.0.tar.gz
| Download URL | yatts-1.0.0.tar.gz |
|---|---|
| Size | 149.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f99f064d029a64b29679d53e964674b8330e40aaf8eaf2fe777bba694666402
|
|
BLAKE2b-256 checksum How to use checksums |
d8bc3a280ca0976e3063fab6478725f08f7652922def77d7306eedd68174a816
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|
Release files / yatts-1.0.0-py3-none-any.whl
| Download URL | yatts-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e245bf972e25931ec3827bb7628a00abb6a323d69c2d85ebca2c78e6ef3c246
|
|
BLAKE2b-256 checksum How to use checksums |
241ed430913badc14e1e528f943643ff27530090df8482967a134f9892ddb521
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|