Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

tingetone

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tingetone

ANSI color formatting for output in terminal

pipPyPI
Version
0.0.2
Maintainers
1

tingetone

ANSI color formatting for output in terminal

made with python Code style: black Downloads

Setup and Installation

Using pip

pip install tingetone

Example

Foreground

from tingetone import colored

print(colored("This is red text", color="red"))

Or

from tingetone import cprint

cprint("Hello there", color="green")

Foreground and Background

from tingetone import colored

print(colored("Green on white", color="green", on_color="white"))

Or

from tingetone import cprint

cprint("Red on black", color="red", on_color="black")

Styling

underline & italic are not supported on windows

from tingetone import italic, underline, bold

print(italic("This is italic"))
print(underline("This is underlined"))
print(bold("This is bold"))

Styling with Foreground and Background

from tingetone import colored, italic, underline, bold

print(
    underline("This is red on white",
    color="red",
    on_color="white")
)

print(
    italic("This is italic",
    color="green")
)

Specific Use Cases

These method prints by default & return None

from tingetone import warn, error, info, success

warn("This is warning") # yellow bold text
info("This is to inform") # blue bold text
success("Success", strong=False) # green normal text
error("Error: File Missing") # red bold text

Horizontal Line (width equal to terminal width)

from tingetone import line

line()  # a horizontal line
line(text="Hello")  # horizontal line with text in middle
line(text="Hello", color="red") # red color line with text in middle
help(line)  # for more info

Available Colors and Styles

Foreground(color)Background(on_color)
BlackGrey
RedRed
GreenGreen
YellowYellow
BlueBlue
MagentaMagenta
CyanCyan
WhiteWhite


StyleBoldItalicUnderline

FunctionParametersUse for
coloredtext, color, on_colorColored text
italictext, color, on_colorItalic colored text
underlinetext, color, on_colorUnderlined colored text
boldtext, color, on_colorBold colored text
warntextYellow Bold Warning text
errortextRed Bold Error text
infotextBlue Bold Information text
successtextGreen Bold Success text

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts