Skip to main content

print-color

test downloads

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:

  • tag
  • tag_color or tag_colour
  • tag_format
  • color or colour
  • 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 or tag_colour
    • color
  • color or colour
    • 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')

Success tag

print("Error detected", tag='failure', tag_color='red', color='magenta')

Error tag

print("Printing in color", color='green', format='underline', background='grey')

Printing in color is easy

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

Release files for print-color 0.4.8

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

Source distribution (sdist)

Source distribution for print-color 0.4.8
File Size Uploaded
print_color-0.4.8.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for print-color 0.4.8
File Interpreter ABI Platform
print_color-0.4.8-py3-none-any.whl Python 3 none any Details

Total release size: 16.1 kB

Release history Release notifications | RSS feed

This release

0.4.8 This release

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.3

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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