All Projects → darxtrix → Lehar

darxtrix / Lehar

Licence: mit
Visualize data using relative ordering

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects
python2
120 projects

Projects that are alternatives of or similar to Lehar

Cowsay Files
A collection of additional/alternative cowsay files.
Stars: ✭ 216 (+166.67%)
Mutual labels:  terminal, unicode, ascii, ascii-art
Unibits
Visualize different Unicode encodings in the terminal
Stars: ✭ 125 (+54.32%)
Mutual labels:  terminal, unicode, ascii
durdraw
Animated Unicode, ANSI and ASCII Art Editor for Linux/Unix/macOS
Stars: ✭ 55 (-32.1%)
Mutual labels:  unicode, ascii, ascii-art
Diagon
Interactive ASCII art diagram generators. 🌟
Stars: ✭ 189 (+133.33%)
Mutual labels:  unicode, ascii, ascii-art
Ftxui
💻 C++ Functional Terminal User Interface. ❤️
Stars: ✭ 433 (+434.57%)
Mutual labels:  terminal, ascii, ascii-art
Csconsoleformat
.NET C# library for advanced formatting of console output [Apache]
Stars: ✭ 296 (+265.43%)
Mutual labels:  terminal, ascii, ascii-art
Tart
Tart - draw ASCII art in the terminal with your mouse!
Stars: ✭ 296 (+265.43%)
Mutual labels:  terminal, ascii, ascii-art
Diagram
CLI app to convert ASCII arts into hand drawn diagrams.
Stars: ✭ 642 (+692.59%)
Mutual labels:  terminal, ascii, ascii-art
Ascii Generator
ASCII generator (image to text, image to image, video to video)
Stars: ✭ 939 (+1059.26%)
Mutual labels:  ascii, ascii-art
Wego
weather app for the terminal
Stars: ✭ 6,918 (+8440.74%)
Mutual labels:  terminal, ascii-art
Pic2ascii
Converts a picture and video to ascii art
Stars: ✭ 79 (-2.47%)
Mutual labels:  ascii, ascii-art
Git Praise
A nicer git blame.
Stars: ✭ 24 (-70.37%)
Mutual labels:  terminal, unicode
Cfonts
Sexy fonts for the console
Stars: ✭ 789 (+874.07%)
Mutual labels:  ascii, ascii-art
Ascii canvas
ASCII canvas for drawing in console
Stars: ✭ 11 (-86.42%)
Mutual labels:  ascii, ascii-art
Slug Generator
Slug Generator Library for PHP, based on Unicode’s CLDR data
Stars: ✭ 740 (+813.58%)
Mutual labels:  unicode, ascii
Android Img2ascii
Convert image to ascii.
Stars: ✭ 30 (-62.96%)
Mutual labels:  ascii, ascii-art
Ascii Generator.site
Django website for generating ASCII-arts out of images or text 🎨
Stars: ✭ 77 (-4.94%)
Mutual labels:  ascii, ascii-art
Unicodeplots.jl
Unicode-based scientific plotting for working in the terminal
Stars: ✭ 724 (+793.83%)
Mutual labels:  terminal, unicode
Ascii Doughnut
Animated spinning doughnut in ASCII
Stars: ✭ 29 (-64.2%)
Mutual labels:  ascii, ascii-art
Video To Ascii
It is a simple python package to play videos in the terminal using characters as pixels
Stars: ✭ 960 (+1085.19%)
Mutual labels:  terminal, ascii

lehar

Header image

travis_badge Code Climate Test Coverage Issue Count

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.

# Find commits by authors in a git repo
$ git shortlog -s | cut -f1 | lehar
▇▁▁▁▁▁▁▂▃▁▁█▁▁▂▃▅▁▁▁▂▆▁▁▁▂▁▁▁▁▂▇▁▅▆▁▁▁▄▁▁█▁▁▂▁▂▁

Some cool usage

Why ? : https://medium.com/@darxtrix/visualizing-data-in-terminal-using-lehar-7cfded09c1ad

Note

Each data point in the data set is plotted relative to the maximum data point value with the maximum having the highest plot height. And they are only 5 possible heights so two number with very less fraction difference relative to max data point can take same plot height. Its a way of visualizing variations in data.

Demo

Installation

Using pip

$ pip install lehar

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")

Command line

$ lehar 1 2 3 4 5

$ lehar -c red 1 2 3 4 5

$ echo "-c cyan 1 2 3 4 5" | lehar

$ lehar < input

Support

lehar supports both Python2 & Python3.

Contributing Guide

  • Setup
$ git clone https://github.com/darxtrix/lehar
$ cd lehar 
$ pip install -r requirements.txt
$ python setup.py develop
$ lehar 
  • Tests are located at lehar/tests.py and covergae tests are located at .travis.yml
$ python tests.py
  • While sending a pull request increment the version at VERSION and make sure the travis build passes.

Some feedback please

Please file as issue here for suggesting the improvements required.

License

MIT © Ankush Sharma

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].