Sometimes insights can be drawn from visualizations of data rather than staring at it. The post is about a terminal visualization tool that is open sourced at TL;DR: lehar https://github.com/darxtrix/lehar While hacking on last week, I thought of adding a network sensor to it but I was stuck thinking how will I visualize it to the end user. Just a heads up, is a task manager in that I worked upon as a side project back in 2015. It went on to hit the list of repositories on GitHub. ptop ptop Python trending A network sensor will basically show the current incoming/outgoing data on the network to the user. For eg. the of showing the CPU info looks like this: CPU sensor ptop CPU usage info in ptop One distinction we can draw from here is that in case of sensors like CPU, memory we have an but in case of a network sensor we don’t have one. So the visualization should make user understand that the network utilization was more at a point as compared to a point along with showing the up-speed & down-speed, so upper_bound t1 t2 relative ordering of data is needed here. I tried to draw an analogy with the standard problem where the data can be as random as network speed at a certain point of time(position in case of sorting). So, I wanted to come up with a way to show the movement(swaps) in case of a standard sorting algorithm, i.e something like this GIF: sorting provides a shell command for creating such visualizations out of but I can’t find any Python library for this. So I wrote . can be used as a and module and at the same time it can be used as shell command. The code is open sourced at Spark data lehar lehar Python2 Python3 GitHub uses the of data to represent it. For eg. data = [1,2,3,4,5] will be represented as ▂▄▅▇█ ( increasing heights) lehar relative ordering For drawing such visualizations, just call the dead simple API in your code. For eg. the code I used for drawing the above visualizations is a slight modification of the standard program where instead of moving smaller elements in the front of the array, the larger ones’ are moved towards the end. Apart from that, we are just printing partially sorted data at line#10 and giving a time delay in line#21 with a following in next line to print things in the same line in the terminal lehar Python Selection Sort carriage return And, yes has support for colors too ! lehar And finally, the network sensor can be visualized like this along with the network stats: Network visualization ptop You can contribute to and find the usage instructions at lehar https://github.com/darxtrix/lehar/ In case you liked the story, hit claps. For any reviews/thoughts or any alternate ways to show this info in terminal do comment here. Let’s share and connect on Twitter @darxtrix