Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jramrath committed Feb 4, 2022
2 parents 2768f40 + 510ba87 commit 4df37f6
Show file tree
Hide file tree
Showing 20 changed files with 256 additions and 24 deletions.
52 changes: 48 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,53 @@
# colorText
# textColor

This is a easy to use Python Library which allows you to make your Terminal outputs more colorful and therefore easyer to understand.
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 is Jannik Ramrath (R2-D2-JR)
The creator and maintainer is Jannik Ramrath (jramrath)

GitHub: https://github.com/R2-D2-JR/textColor
GitHub: https://github.com/jramrath/textColor

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


# Installation

This library is hosted on [pypi.org](https://pypi.org/project/textColor/). You can install it with **pip**:

`pip install textColor`


# Usage

To use this library, you first have to import it:
```
from textColor import tc
```

To print colored text do the following:
```
print(tc.green("GREEN")) # 'GREEN' will be green
print(tc.green("RED")) # 'RED' will be red
print(tc.green("BLUE")) # 'BLUE' will be blue
print(tc.green("YELLOW")) # 'YELLOW' will be yellow
```

You can also use special 'pre-fixes':
```
print(tc.input("Name: ")) # will output '[?] Name: ' while '[?]' is yellow
print(tc.info("Info")) # will output '[-] Info' while '[-]' is blue
print(tc.error("ERROR")) # will output '[!] ERROR' while '[!]' is red
print(tc.output("Success")) # will output '[>] Success' while '[>]' is green
```



# License

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


# 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.
Empty file added build/lib/test/__init__.py
Empty file.
14 changes: 14 additions & 0 deletions build/lib/test/test_textColor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from textColor import tc

def test():
print("Starting test ...")

print(tc.green("This should be green"))
print(tc.red("This should be red"))
print(tc.blue("This should be blue"))
print(tc.yellow("This should be yellow"))

print(tc.input("INPUT"))
print(tc.info("INFO"))
print(tc.error("ERROR"))
print(tc.output("OUTPUT"))
1 change: 0 additions & 1 deletion build/lib/textColor/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
#__init__.py
File renamed without changes.
36 changes: 36 additions & 0 deletions build/lib/textColor/tc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
def green(text, whiteText="", space=True):
if space:
return "\033[1;32;49m" + str(text) + " \033[0;37;49m" + str(whiteText)
else:
return "\033[2;32;49m" + str(text) + "\033[0;37;49m" + str(whiteText)

def red(text, whiteText="", space=True):
if space:
return "\033[1;31;49m" + str(text) + " \033[0;37;49m" + str(whiteText)
else:
return "\033[1;31;49m" + str(text) + "\033[0;37;49m" + str(whiteText)

def blue(text, whiteText="", space=True):
if space:
return "\033[1;34;49m" + str(text) + " \033[0;37;49m" + str(whiteText)
else:
return "\033[1;34;49m" + str(text) + "\033[0;37;49m" + str(whiteText)

def yellow(text, whiteText="", space=True):
if space:
return "\033[1;33;49m" + str(text) + " \033[0;37;49m" + str(whiteText)
else:
return "\033[1;33;49m" + str(text) + "\033[0;37;49m" + str(whiteText)


def input(text):
return "\033[1;33;49m" + "[?]" + " \033[0;37;49m" + str(text)

def info(text):
return "\033[1;34;49m" + "[-]" + " \033[0;37;49m" + str(text)

def error(text):
return "\033[1;31;49m" + "[!]" + " \033[0;37;49m" + str(text)

def output(text):
return "\033[1;32;49m" + "[>]" + " \033[0;37;49m" + str(text)
File renamed without changes.
36 changes: 36 additions & 0 deletions build/lib/textColor/textColorFunctions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
def green(colorText, whiteText="", space=True):
if space:
return "\033[1;32;40m" + str(colorText) + " \033[0;37;40m" + str(whiteText)
else:
return "\033[2;32;40m" + str(colorText) + "\033[0;37;40m" + str(whiteText)

def red(colorText, whiteText="", space=True):
if space:
return "\033[1;31;40m" + str(colorText) + " \033[0;37;40m" + str(whiteText)
else:
return "\033[1;31;40m" + str(colorText) + "\033[0;37;40m" + str(whiteText)

def blue(colorText, whiteText="", space=True):
if space:
return "\033[1;34;40m" + str(colorText) + " \033[0;37;40m" + str(whiteText)
else:
return "\033[1;34;40m" + str(colorText) + "\033[0;37;40m" + str(whiteText)

def yellow(colorText, whiteText="", space=True):
if space:
return "\033[1;33;40m" + str(colorText) + " \033[0;37;40m" + str(whiteText)
else:
return "\033[1;33;40m" + str(colorText) + "\033[0;37;40m" + str(whiteText)


def input(text):
return "\033[1;33;40m" + "[?]" + " \033[0;37;40m" + str(text)

def info(text):
return "\033[1;34;40m" + "[-]" + " \033[0;37;40m" + str(text)

def error(text):
return "\033[1;31;40m" + "[!]" + " \033[0;37;40m" + str(text)

def output(text):
return "\033[1;32;40m" + "[>]" + " \033[0;37;40m" + str(text)
Binary file removed dist/textColor-0.0.1.tar.gz
Binary file not shown.
Binary file not shown.
Binary file added dist/textColor-1.0.1-py3-none-any.whl
Binary file not shown.
Binary file added dist/textColor-2.0.0-py3-none-any.whl
Binary file not shown.
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@

setuptools.setup(
name="textColor",
version="0.0.1",
version="2.0.0",
author="Jannik Ramrath",
author_email="jannik.ramrath@gmail.com",
description="The purpose of this Library is to add easy acces to colored output in the Terminal with Python3",
author_email="textcolor@ramrath.anonaddy.me",
description="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",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/R2-D2-JR/textColor",
url="https://github.com/jramrath/textColor",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
setup_requires=['pytest-runner'],
test_require=['pytest>=4.4.1'],
test_suit='test'
)
Empty file added test/__init__.py
Empty file.
14 changes: 14 additions & 0 deletions test/test_textColor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from textColor import tc

def test():
print("Starting test ...")

print(tc.green("This should be green"))
print(tc.red("This should be red"))
print(tc.blue("This should be blue"))
print(tc.yellow("This should be yellow"))

print(tc.input("INPUT"))
print(tc.info("INFO"))
print(tc.error("ERROR"))
print(tc.output("OUTPUT"))
73 changes: 60 additions & 13 deletions textColor.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,23 +1,70 @@
Metadata-Version: 2.1
Name: textColor
Version: 0.0.1
Summary: The purpose of this Library is to add easy acces to colored output in the Terminal with Python3
Home-page: https://github.com/R2-D2-JR/textColor
Version: 2.0.0
Summary: 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
Home-page: https://github.com/jramrath/textColor
Author: Jannik Ramrath
Author-email: jannik.ramrath@gmail.com
Author-email: textcolor@ramrath.anonaddy.me
License: UNKNOWN
Description: # colorText

This is a easy to use Python Library which allows you to make your Terminal outputs more colorful and therefore easyer to understand.

It currently only works with Python3

The creator is Jannik Ramrath (R2-D2-JR)

GitHub: https://github.com/R2-D2-JR/textColor
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# textColor

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

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


# Installation

This library is hosted on [pypi.org](https://pypi.org/project/textColor/). You can install it with **pip**:

`pip install textColor`


# Usage

To use this library, you first have to import it:
```
from textColor import tc
```

To print colored text do the following:
```
print(tc.green("GREEN")) # 'GREEN' will be green
print(tc.green("RED")) # 'RED' will be red
print(tc.green("BLUE")) # 'BLUE' will be blue
print(tc.green("YELLOW")) # 'YELLOW' will be yellow
```

You can also use special 'pre-fixes':
```
print(tc.input("Name: ")) # will output '[?] Name: ' while '[?]' is yellow
print(tc.info("Info")) # will output '[-] Info' while '[-]' is blue
print(tc.error("ERROR")) # will output '[!] ERROR' while '[!]' is red
print(tc.output("Success")) # will output '[>] Success' while '[>]' is green
```



# License

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


# 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.

5 changes: 4 additions & 1 deletion textColor.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
LICENSE
README.md
setup.py
textColor/TextColor.py
test/__init__.py
test/test_textColor.py
textColor/__init__.py
textColor/tc.py
textColor.egg-info/PKG-INFO
textColor.egg-info/SOURCES.txt
textColor.egg-info/dependency_links.txt
Expand Down
1 change: 1 addition & 0 deletions textColor.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test
textColor
1 change: 0 additions & 1 deletion textColor/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
#__init__.py
36 changes: 36 additions & 0 deletions textColor/tc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
def green(text, whiteText="", space=True):
if space:
return "\033[1;32;49m" + str(text) + " \033[0;37;49m" + str(whiteText)
else:
return "\033[2;32;49m" + str(text) + "\033[0;37;49m" + str(whiteText)

def red(text, whiteText="", space=True):
if space:
return "\033[1;31;49m" + str(text) + " \033[0;37;49m" + str(whiteText)
else:
return "\033[1;31;49m" + str(text) + "\033[0;37;49m" + str(whiteText)

def blue(text, whiteText="", space=True):
if space:
return "\033[1;34;49m" + str(text) + " \033[0;37;49m" + str(whiteText)
else:
return "\033[1;34;49m" + str(text) + "\033[0;37;49m" + str(whiteText)

def yellow(text, whiteText="", space=True):
if space:
return "\033[1;33;49m" + str(text) + " \033[0;37;49m" + str(whiteText)
else:
return "\033[1;33;49m" + str(text) + "\033[0;37;49m" + str(whiteText)


def input(text):
return "\033[1;33;49m" + "[?]" + " \033[0;37;49m" + str(text)

def info(text):
return "\033[1;34;49m" + "[-]" + " \033[0;37;49m" + str(text)

def error(text):
return "\033[1;31;49m" + "[!]" + " \033[0;37;49m" + str(text)

def output(text):
return "\033[1;32;49m" + "[>]" + " \033[0;37;49m" + str(text)

0 comments on commit 4df37f6

Please sign in to comment.