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.

Metadata

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 Provenance Actions
textcolor-3.1.0.tar.gz 14.4 kB Without provenance Details for textcolor-3.1.0.tar.gz

Built distribution (wheel)

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

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

Security for textColor 3.1.0

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.

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