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.
Usage: from display_tools import TextOutput as out
>>> 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
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
Usage: from display_tools import ConsoleAnimations
>>> wait = ConsoleAnimations()
>>> while not something_needs_to_complete:
... wait.pin_wheel()
>>> wait = ConsoleAnimations()
>>> while not something_needs_to_complete:
... wait.moving_bar()
- 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