A package of the students to beautify their console
Project description
Prettyfy
A package of the everyone to beautify their console applicaions and CLI's(Command Line Interfaces).
Installation
pip install prettyfy
github page:
Usage
import prettyfy
from prettyfy import *
import os
colorize = TextColorizer
colorize.DefaultBg = "bright_cyan"
colorize.DefaultFg = "black"
colorize().SetDefaultTheme()
init_boxStyle("Shanti-style", (("<->", "<->", "<->"), ("<->", "<->", "<->"), "<+>"))
def Option1():
Print("This is option 1")
def Option2():
Print("This is option 2")
def Option3():
Print("This is option 3")
def Option4():
Print("This is option 3")
menuList = ["Option1", "Option2", "Option3", "Option4"]
choice = MenuDriver(TextColorizer=colorize, MenuList=menuList, header = "Shanti-style", header_border_style = "Shanti-style", SelectionStyle = "INVERT", BgColor = "bright_cyan", FgColor = "black" ).GetChoice()
exec(f"{choice}()")
ColorizeText = colorizeText
colorizeText(FgColor="black", BgColor="cyan", string="Hope this works...")
colorizeText(FgColor="bright_white", BgColor="bright_red", string="This must be bright")
colorizeText(FgColor="white", BgColor="red", string="This must be normal JustTextBG", JustTextBG = True)
colorizeText(FgColor="white", BgColor="red", string="""This must be normal
...I think""")
Print("This is another print")
colorizeText(FgColor="white", BgColor="red", string="""This must be normal
...I think JustTextBG""", JustTextBG = True)
colorizeText(FgColor="white", BgColor="red", string={1:"one", 2:"two", 3:"three"}, JustTextBG = True)
Print(45654)
Print({1:"one", 2:"two", 3:"three"})
Print("This is another print")
Print("This is another print")
Print("This is another print", "This is continued", "Sep test", sep="///////////")
boxed = Decor.boxstr("bold", """Love
Coding""")
Print(boxed)
Print()
colorize(FgColor="white", BgColor="red", string=boxed).Colorize(JustTextBG = True)
Print()
colorize(FgColor="white", BgColor="red", string=boxed).Colorize()
val = Input("\nGetting colored input: ")
Print(val)
boxed1 = Decor.boxstr(string="""Love
Coding...""", style="Shanti-style")
Print(boxed1)
input()
colorize().Reset()
Examples
Menu
Text colorization
Building CLI
# ---------------------------Under development--------------------------------
from prettyfy.CliUtils import *
import hashlib
TextColorizer.DefaultBg = 'black'
TextColorizer.DefaultFg = 'bright_green'
TextColorizer().SetDefaultTheme()
header = decor.boxstr(style = 'simple', string = "Hash-gen")
Print(header)
@CliUtils()
def gen_hash(name):
txt = name.encode()
print(hashlib.md5(txt).hexdigest())
TextColorizer().Reset()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prettyfy-0.2.tar.gz
(9.5 kB
view details)
Built Distribution
prettyfy-0.2-py3-none-any.whl
(11.6 kB
view details)
File details
Details for the file prettyfy-0.2.tar.gz
.
File metadata
- Download URL: prettyfy-0.2.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 924efbc10f18177e166e768682d27bed580f6ba516f29bb4f422e12346186022 |
|
MD5 | 52716abd0861372df1db96f5b9b7a5a6 |
|
BLAKE2b-256 | c9dbd9f4001106d37ef5b4c8fc6b8671906ca090d5b9b8cdf2e5102935e20940 |
File details
Details for the file prettyfy-0.2-py3-none-any.whl
.
File metadata
- Download URL: prettyfy-0.2-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 099cabd1b6fd6f2f8c4b0ca2abdc1e6a395c8ee486e2f09f975f25040e05e3aa |
|
MD5 | 857d0189527f6f3f744c54b3848f729a |
|
BLAKE2b-256 | 3877812188b90a2240b21f4a006596cd66fd52ecc819b1f9b54978262badffb4 |