A simple package to print in color to the terminal
Project description
print-color
Print Color is a minimalist approach to terminal color printing in Python. It is a wrapper around the print()
function, and simply allows you to provide extra optional parameters such as:
tag
tag_color
ortag_colour
color
orcolour
background
format
It aims to be a customizable logger for your applications, and makes formatting warnings, info messages and errors a breeze.
Information
This project has no dependencies, apart from pytest
for testing.
Check out this project on PyPi here.
Colors:
purple
blue
green
yellow
red
magenta
cyan
white
black
Parameter values:
tag
- any string
tag_color
ortag_colour
- color
color
orcolour
- color
background
- color
format
- bold
- underline
- blink
Installing
pip3 install print-color
Requirements
- python 3.7^
Usage
from print_color import print
print("Hello world", tag='success', tag_color='green', color='white')
print("Error detected", tag='failure', tag_color='red', color='magenta')
print("Printing in color", color='green', format='underline', background='grey')
Contributing
Feel free to add or improve this project :) Just create a pull request and explain the changes you propose. Note that as this is a very simple project, feature requests should be kept minimal - things like more colors, formats etc would be ideal.
Credits
Built with Python Poetry.
Contributors
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file print_color-0.4.6.tar.gz
.
File metadata
- Download URL: print_color-0.4.6.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.9.16 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3aafc1666c8d31a85fffa6ee8e4f269f5d5e338d685b4e6179915c71867c585 |
|
MD5 | f295a0d42e90d0ed4fedfbd8bfdb0564 |
|
BLAKE2b-256 | eb32601fd9002509b32d1f9d3ec1e8cc5af9af619def83327adbb1ea18e1502a |
File details
Details for the file print_color-0.4.6-py3-none-any.whl
.
File metadata
- Download URL: print_color-0.4.6-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.9.16 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 494bd1cdb84daf481f0e63bd22b3c32f7d52827d8f5d9138a96bb01ca8ba9299 |
|
MD5 | 9ab7eed20aee0b46ec346ffc3d66cd7f |
|
BLAKE2b-256 | 7db81e2340eb96e8620217e26644192d35ad8300a4bd346dff1d5a02eb7d737d |