Giter VIP home page Giter VIP logo

print-color's Introduction

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

pip3 install 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 Python Poetry.

Contributors

print-color's People

Contributors

jfloyd1697 avatar marcos-lima-stormgroup avatar payneio avatar stevegoodenough avatar xy3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

print-color's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.