A simple package to print in color to the terminal
Project description
print-color
from print_color import print
print("Hello world", tag='success', tag_color='green', color='white')
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:
tagtag_colorortag_colourtag_formatcolororcolourbackgroundformat
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_colorortag_colour- color
colororcolour- color
background- color
format- bold
- underline
- blink
Installing
pip install print-color
Or with uv:
uv add 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 standard Python tooling. Supports pip and uv.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file print_color-0.4.7.tar.gz.
File metadata
- Download URL: print_color-0.4.7.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f07ab99f45d1439c7b88a0930a775affcade40ad04259e2f77d18fd643d5328
|
|
| MD5 |
99c78818a70f5f686c2a46dc7762e74d
|
|
| BLAKE2b-256 |
2bf41cdb69e5628aa15fbb7937bb7d13d0d336c126f378107414604f3f662d36
|
File details
Details for the file print_color-0.4.7-py3-none-any.whl.
File metadata
- Download URL: print_color-0.4.7-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ec1706f9cec1b0e79d3c8a4da51d4c880080b0864c0966281d8be7b8207c093
|
|
| MD5 |
21063de7ab0f38c7a16fa7cc70615db8
|
|
| BLAKE2b-256 |
4724730a43899f1a66fb2e8b797804087253f17ff8104919dd6c5cbbab1f5748
|