Skip to main content

This is an easy to use Python library which allows you to make your terminal outputs more colorful and therefore easier to read and understand.

It currently only works with Python3

The creator and maintainer is Jannik Ramrath (jramrath)

GitHub: https://github.com/jramrath/textColor

PyPi: https://pypi.org/project/textColor/

Contributing

If you've found a bug or a typo, feel free to open an Issue on GitHub. Already have a solution? Make a Pull request and I'll take a look at your changes. Please make sure a similar Issue/Pull request doesn't already exist.

Installation

This library is hosted on pypi.org. You can install it with pip:

pip install textColor

Usage

To use this library, you first have to import it:

import textColor

To print colored text do the following:

print(textColor.green("GREEN"))           # 'GREEN' will be green
print(textColor.red("RED"))               # 'RED' will be red
print(textColor.blue("BLUE"))             # 'BLUE' will be blue
print(textColor.yellow("YELLOW"))         # 'YELLOW' will be yellow

You can also use special 'pre-fixes':

print(textColor.prompt("Name: "))         # will output '[?] Name: '  while '[?]' is yellow
print(textColor.info("Info"))             # will output '[-] Info'    while '[-]' is blue
print(textColor.error("ERROR"))           # will output '[!] ERROR'   while '[!]' is red
print(textColor.output("Success"))        # will output '[>] Success' while '[>]' is green

If you dont' want to type input()/print() you can use the 'print functions':

textColor.pPromt("Name: ")                # will call input("[?] Name: ") and return
                                          #  the output, while '[?]’ is yellow
textColor.pInfo("Info")                   # will output '[-] Info'    while '[-]' is blue
textColor.pError("Error")                 # will output '[!] ERROR'   while '[!]' is red
textColor.pOutput("Success")              # will output '[>] Success' while '[>]' is green

If those function names seem too long, you should use abbreviations:

green   ––> g
red     ––> r
blue    ––> b
yellow  ––> y

error   ––> err
output  ––> out

pError  ––> pErr
pOutput ––> pOut

License

This library was published under the GNU General Public License. For more information take a look at the LICENSE file.

Release files for textColor 3.1.0

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

Source distribution (sdist)

Source distribution for textColor 3.1.0
File Size Uploaded
textcolor-3.1.0.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for textColor 3.1.0
File Interpreter ABI Platform
textcolor-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.2 kB

Release files / textcolor-3.1.0.tar.gz

Download URL textcolor-3.1.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5be1df153efccede3e6976e9c4de49c3df900117e3f6227bc6a0e5e57ff99a5b
BLAKE2b-256 checksum
How to use checksums
b2c622e1b6e2859e8c09131b202f3db6b4ea667e255ebb1971c897ca40ce8c9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / textcolor-3.1.0-py3-none-any.whl

Download URL textcolor-3.1.0-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b91cf4f1d2c3e4f1bc3970d034572c64bb2268a92b84ad72c6344dcae702649
BLAKE2b-256 checksum
How to use checksums
7f83ffdc89bcb9f32e7e2fbfaf2f7469a295eddace8447ca9623ea3b993b5927
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.1

1 release file

2.0.0

1 release file

1.0.1

2 release files

0.1.0

1 release file

0.0.1

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