Giter VIP home page Giter VIP logo

display_tools's Introduction

Display Tools

This is a utility module for common console output tasks such as colored output and wait animations. I have found myself reusing these function quite often so I figured it would be useful to have them all in one place.

Text formatting and output

Usage: from display_tools import TextOutput as out

Colored alert messages

>>> out.info('Yo, here is an info message')
[ INFO ] Yo, here is an info message

>>> out.warn('Aww snap, you have been warned')
[ WARN ] Aww snap, you have been warned

>>> out.error('Your shit is broke')
[ ERROR ] Your shit is broke

Output list or dictionary

out.dict({'name': 'Jason Sims', 'email': '[email protected]', 'twitter': '@_jasonsims'})
email       : [email protected]
name        : Jason Sims
twitter     : @_jasonsims

>>> out.list(['Beets', 'Bears', 'Battlestar Galactica' ])
Beets
Bears
Battlestar Galactica

Progress display

Usage: from display_tools import ConsoleAnimations

Pinwheel animation

>>> wait = ConsoleAnimations()
>>> while not something_needs_to_complete:
...   wait.pin_wheel()

Infinate progress bar

>>> wait = ConsoleAnimations()
>>> while not something_needs_to_complete:
...   wait.moving_bar()

Comming Soon

  • Progress bar
  • Animations that run in their own thread
  • Ability to output text with color_name as a parameter
  • Paramaters for dict output
  • Status messages will incorporate a logger object

display_tools's People

Contributors

jasonsims avatar

Stargazers

 avatar

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.