Package: colorido
ColoridoColors for Terminal without weird code.DescriptionColorido is a small Python 3.x lib to speed up the text coloring throughout
your Python projects. You ever can make your logs prettier. ;)You don't need to install any dependency to use colorido. In a nutshell, just
import thecolormodule from thecoloridopackage and call the functions
in a print context to start coloring your strings.InstallationInstall it with pip by running:pipinstallcoloridoUsageTo use the colorido abilities, import thecolormodule in your code and just
call the function with the color you want to print. See how in the example
below:fromcoloridoimportcolorprint('This is the color '+color.red('red')+'.')ColoringYou can choose the color you want among the eight available color options. The
supported options are:Text colorFunctionBlackblack(str)Blueblue(str)Cyancyan(str)Greengreen(str)Magentamagenta(str)Redred(str)Whitewhite(str)Yellowyellow(str)ℹ️Note:the visual colors may vary according with the configuration of
your Terminal or system.Basic examplesBelow we have some examples of colorido's general usage.Example 1:fromcoloridoimportcolortext=color.green('BR')+color.yellow('AZ')+color.blue('IL')print('Come to visit%s.'%text)Example 2:fromcoloridoimportcolorprint(f'sudo{color.red("rm -rf /")}')Example 3:fromcoloridoimportcolorprint('Is zebra{black}with{white}stripes or{white}with{black}stripes?'.format(black=color.black('BLACK'),white=color.white('WHITE'),))StylingColorido also support text styling. The styles modify the heavy of the text.
The supported styles are:Dim textNormal textBold textYou can style your text by passing an extra optionalstyleparameter to the
color functions. For example, to get a bold red text, you can do:Example 4:fromcoloridoimportcolorprint(color.red('STOP',style='bold'),'deploys at friday!')You can also omit thestylekeyword and pass the style parameter just like a
positional parameter.Example 5:fromcoloridoimportcolorprint(color.magenta('Dimmed','dim'),'texts are calm.')Colorido supports three types of text styling.Text styleParameterDim'd'or'dim'Normal'n'or'normal'(default)Bold'b'or'bold'If you don't want to color your text, you can use thefont()function to skip
the text coloring. For this, provide the desired style parameter just like you
do in the coloring functions. See how:Example 6:fromcoloridoimportcolorprint('{I}{love}{linux}.'.format(I=color.font('I','bold'),love=color.red('<3','bold'),linux=color.font('Linux','dim'),))Background colorNew in version 1.0.0!You can also color the background of your logs! Just provide abgparameter
to any color function with the name of the color you want.Example 7:fromcoloridoimportcolorprint('The sun rules the{day}and the moon rules the{night}.'.format(day=color.yellow('day',bg='white'),night=color.blue('night',bg='black'),))The available background colors are the same eight available in the foreground
text colors. Below you have a list with the color options:Background colorParameterBlack'black'Blue'blue'Cyan'cyan'Green'green'Magenta'magenta'Red'red'White'white'Yellow'yellow'If you want to use just the background color, with no foreground text color,
you can call again thefont()function, providing thebgparameter. For
example:Example 8:fromcoloridoimportcolorprint('If your{code}have many{bugs}, you propably need more{coffee}.'.format(code=color.font('code',bg='blue'),bugs=color.font('bugs',bg='red'),coffee=color.font('coffee',bg='black'),))You can also style your text while you choose your background color, just like we
have done instyling section. See an example:Example 9:fromcoloridoimportcolorprint('The{white}{light}can split in a beautiful{ra}{i}{n}{b}{o}{w}.'.format(# We can style and also background our text with font() functionwhite=color.font('white','bold',bg='white'),light=color.font('light','bold',bg='black'),ra=color.red('ra'),i=color.yellow('i'),n=color.green('n'),b=color.cyan('b'),o=color.blue('o'),w=color.magenta('w'),))That's all folks! Bugs, questions or coffees, feel free to reach me in mye-mail.Who is this lib for?Colorido is addressed to anyone who wants a simple lib to print colored
texts in the screen without a hundred of things to learn. You just need to
import the module and call the functions you want to.Colorido doesn't match programmers that want a full-featured lib. It just
returns colored texts to be printed in the screen. No things more. If this is not
your vibe, consider search for other python libraries (like colorama, colored or
PyColor).LicenseThis lib is a free software and is distributed under theMIT License.