Rong - A console coloring utility for Python console apps
Developed by Md. Almas Ali
Version 0.0.2
Installation
It is very easy to install. Like as usual you can install it with pip.
pip install rong
Documentation
Welcome to Rong documentation,
Here you will learn about a CLI tool which can add color into your CLI bashed project. Highly recomended module in python by developers. Its easy to use and easily adaptable to every lavel developers. Anyone can learn this in 10 min.
Give it a try ?
Project index's
- Color & Style codes
- Log class
- Mark class
- Highlight class
- Text class
- Examples for practice
- Latest changes history
-
Color & Styles
-
All Colors for forground and background:
-
black -
red -
green -
yellow -
blue -
purple -
cyan -
white -
orange -
tomato -
pink -
violet -
gray -
darkgreen -
gold -
yellowgreen -
sandybrown -
darkred -
lightgray -
lightblue -
lightgreen -
lightyellow -
lightpurple -
lightcyan -
lightwhite -
lightseagreen -
lightred -
lightpink -
lightorange -
lightviolet -
transparent
-
-
All Styles:
blink: for blinking text in consolebold: for bolding text in consoleclear: for clearing all setted stylesconcealed: for concealing text in consoleinvisible: for making text invisible in consoleitalic: for italicizing text in consoleoverline: for overlining text in consolereverse: for reversing text in consolestrike: for strike text in consoleunderline: for underlining text in consoleunderline-solid: for solid underlining text in consoleunderline-wavy: for wavy underlining text in consoleunderline-double: for double underlining text in consoleunderline-dotted: for dotted underlining text in consoleunderline-dashed: for dashed underlining text in console
-
NOTE :
- You can use
clearto clear all setted styles. - When you use
underlineit will beunderline-solidby default. underline-wavy,underline-dottedandunderline-dashedunderline is not supported in all terminals.
- You can use
-
-
Log: A simple logging text class for coloring text-
To display primary text
primary(text:str) -
To display blue text
blue(text:str) -
To display success text
success(text:str) -
To display green text
green(text:str) -
To display ok text
ok(text:str) -
To display warning text
warning(text:str) -
To display yellow text
yellow(text:str) -
To display help text
help(text:str) -
To display danger text
danger(text:str) -
To display error text
error(text:str) -
To display fail message
fail(text:str) -
To display underline
underline(text:str) -
To display bold text
bold(text:str) -
To display ok message
okmsg(text:str) -
To display wait message
waitmsg(text:str) -
To display error message
errormsg(text:str)
-
-
Mark: A simple class for coloring manually in line- To add color manually you need to use this class with some constant color which is binded into this class. You have to manually start the color as, this example bellow:
print(f"This is a {Mark.GREEN}sample Mark{Mark.END} test.")
-
Highlight: A class for highlighing text color-
To get white color
white(text:str) -
To get bold white color
bwhite(text:str) -
To get green color
green(text:str) -
To get bold green color
bgreen(text:str) -
To get blue color
blue(text:str) -
To get bold blue color
bblue(text:str) -
To get yellow color
yellow(text:str) -
To get bold yellow color
byellow(text:str) -
To get red color
red(text:str) -
To get bold red color
bred(text:str)
-
-
Most powerfull, all in one class
Text-
To add forground / text color
foreground(color:str) -
To add backgroung color
background(color:str) -
To add styles as list
style(styles:list) -
To update object text
update(text:str): -
To show output text
print() -
All in one in a single line :
Text(text="Single line test", styles=["bold", "underline-solid"])
-
Some sample codes are for text.
from rong import *
# In line Log display
print(f"I am {Log.waitmsg('Almas')} Ali")
print(f"I am {Log.errormsg('Almas')} Ali")
print(f"I am {Log.warning('Almas')} Ali")
print(f"I am {Log.primary('Almas')} Ali")
# In line color with custom parameter
print(f"{Mark.BLUE} Hi, {Mark.END}")
print(f"{Mark.RED} Hi, {Mark.END}")
print(f"{Mark.GREEN} Hi, {Mark.END}")
print(f"{Mark.CYAN} Hi, {Mark.END}")
print(f"This is a {Mark.GREEN}sample Mark{Mark.END} test.")
# In line text highlighting
print(f"Enjoy {Highlight.red('Almas')}")
print(f"Enjoy {Highlight.bred('Almas')}")
print(f"Enjoy {Highlight.blue('Almas')}")
print(f"Enjoy {Highlight.bblue('Almas')}")
print(f"Enjoy {Highlight.yellow('Almas')}")
print(f"Enjoy {Highlight.byellow('Almas')}")
# Working with Text objects
# Creating Text class object
text = Text(text='Almas Ali')
# Adding forground color / text color
text.foreground('blue')
text.foreground('purple')
# Adding background color
text.background('white')
# Adding custom styles
text.style(styles=['bold', 'underline'])
# Updating object text
text.update(text=' New text ')
# Printing output in two ways
# Advance methode bashed mode
text.print()
# Normal pythonic mode
print(text)
# Doing everything in one line
text1 = Text(text='Demo1', styles=['bold'], fg='blue', bg='white')
text1.print()
# Clearing all styles
text2 = Text(text='Demo', styles=['clear'])
text2.print()
Change History :
0.0.2 - Fixed default background issue, added huge amonut of colors and styles varient. Added more examples and documentation.
0.0.1 - Initialized this project and written all this codes.
Everything is open source. You can contribute in this project by submitting a issue or fixing a problem and make pull request.
Made with love by © Md. Almas Ali
LICENSE under MIT
Metadata
Release files for rong 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rong-0.0.2.tar.gz | 6.9 kB | Without provenance | Details for rong-0.0.2.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rong-0.0.2-py3.10.egg | Legacy Egg format | - | - | Details for rong-0.0.2-py3.10.egg |
| rong-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for rong-0.0.2-py3-none-any.whl |
Total release size: 18.4 kB
Release files / rong-0.0.2.tar.gz
| Download URL | rong-0.0.2.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f0c1476b31293d20325c83cf4da7e17dfa2f512297bb11516359909547b3fd9
|
|
BLAKE2b-256 checksum How to use checksums |
1673f4369aef96b0268021cd122c0495b1ff202a3220b9f3a6880a5c7c6e5b8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Release files / rong-0.0.2-py3.10.egg
| Download URL | rong-0.0.2-py3.10.egg |
|---|---|
| Size | 5.2 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
ba0352bfb675bfdea59b686978a327d462e89d6c2d4cf2bfb2c024f1b3305318
|
|
BLAKE2b-256 checksum How to use checksums |
4da0ce52c048b20ff19cec773c21b06108fb2e3981afd78b3422aa80f88486a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Release files / rong-0.0.2-py3-none-any.whl
| Download URL | rong-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1f91315091c4ae15f85b85e18e271e81dfa64f20074a2bf6df4a20c282ee960
|
|
BLAKE2b-256 checksum How to use checksums |
d7c425c9a43b843f39a7af55d984a28fe4e50ec67f3d6436d00b0d764f80e72e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Security for rong 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.