lehar

Visualize data using relative ordering


Keywords
terminal, sparklines, spark, unicode, lehar, shell, ascii, ascii-art, python, python2, python3, xterm256
License
MIT
Install
pip install lehar==0.4

Documentation

lehar

Header image

Python library to generate sparklines ▁▂▄▅▇█ in your shell based upon relative ordering of data. lehar is a Hindi word which means wave. lehar can be invoked via commandline also.

Some cool usage

Demo

Installation

API

lehar.draw(numbers,options)

numbers

type : list

options

Only supported option is color eg. color='red'

Basic Usage

>>> import lehar

# Strings
>>> lehar.draw(["0","1","2","3","4"])
'▁▂▄▆█'

# Numbers
>>> lehar.draw([0,1,2,3,4])
'▁▂▄▆█'

# Negatives
>>> lehar.draw([1,3,-34,12,44,81,0])
'▃▃▁▄▆█▃'

# Missing data
>>> lehar.draw([1,3,-34,'',12,44,'',81,0])
'▃▃▁ ▄▆ █▃'

Adding colors

>>> lehar.draw(["0","1","2","3","4"],color="yellow")

>>> lehar.draw([1,3,-34,'',12,44,'',81,0],color="cyan")

Commandline

$ lehar 1 2 3 4 5

$ lehar -c red 1 2 3 4 5

Support

lehar supports both Python2 & Python3.

License

MIT © Ankush Sharma