Skip to main content

termicol

A python Simple python function aimed to handle printing of colored and / or decorated text to console / terminal.

​

Installation

With git GitHub:

git clone https://github.com/irtsa-dev/termicol.git

With pip PyPi

pip install idev-termicol






Usage

To import:

from termicol.termicol import *

Then, later on you may utilize:

tprint(content: str, end: str = '\n')
# Prints off text and background in the given color with provided decorations.
# To do so, <> is used similar to html.
# Example being: <t=white>hello

showColorList()
# Prints off a list of valid arguments for color.

showDecorationList()
# Prints off a list of valid arguments for decoration.

​

Code Examples

from termicol.termicol import tprint

tprint("<t=red>hello, this text will be red!")
from termicol.termicol import *

tprint("<t=blue>this text will be blue,<t=red> While this text will be red!")
from termicol.termicol import *

tprint("<t=red><b=blue><d=underline>This will be underlined red text with blue background!")
from termicol.termicol import *

tprint("<t=red><b=blue>This will be red text with a blue background!<r>This will now be the default text.<t=red> Back to red text!<b=white> A blue backround is added.<r=b> Background is now default.")

​

Additional Notes

Valid tags to utilize:

  • t | textcolor
    • Will change the text color, can either be one of the valid color arguments that are seen in showColorList() function or a list of 3 values separated by a comma for rgb values.
    • <t=red> | <t=20,2,30>
  • b | bgcolor | backgroundcolor
    • Will change the background color, can either be one of the valid color arguments that are seen in showColorList() function or a list of 3 values separated by a comma for rgb values.
    • <b=red> | <b=20,2,30>
  • d | deco | decorations
    • Will add in decorations based on what is provided, must be ones provided in the showDecorationList() function.
    • <d=underline> | <d=underline,italic>
  • r
    • Will reset back to default, you can also specify what to reset and provide a list (but only accepts t,b,d).
    • <r> | <r=td>
  • nl
    • Indicates a newline (basically doing \n)
    • <nl>

Metadata

Release files for idev-termicol 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for idev-termicol 1.0.2
File Size Uploaded
idev_termicol-1.0.2.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for idev-termicol 1.0.2
File Interpreter ABI Platform
idev_termicol-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / idev_termicol-1.0.2.tar.gz

Download URL idev_termicol-1.0.2.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4efc650bed820144f38e0199e2cb5f9cc51440041c8c3d2372ad1b26c07a1a94
BLAKE2b-256 checksum
How to use checksums
1653d1987290283e60ce507650182350e833c5a295f5c586a0e17d3f7b019355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / idev_termicol-1.0.2-py3-none-any.whl

Download URL idev_termicol-1.0.2-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cd19a428fd17193d52c102f2a1fe3b45825fbb91393b82d98727b2019c6a1f1
BLAKE2b-256 checksum
How to use checksums
62bb9a3b8f4956a97b77ecb5388af0c50a754056c29538d2dc48ccd079adbdc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page