Termgraph
Version: 0.2.1 Web: https://github. com/mkaz/termgraph
There were days when bulky chart plotters and data ‘recorders’ were the only electronic devices for data visualisation. Not that the history is repeating itself, but we quickly recalled such vintage scientific devices after running Termgraph. This software is designed to print charts and plots in your Linux terminal using the power of Python. It’s another reason to keep on using CLI and sideline overcomplicated graphical tools.
Termgraph can draw bar graphs, colour charts, stacked charts and even use emojis for displaying values Together with tile-based terminal multiplexors (like Terminator), Termgraph is ideal for setting up multiple crime-drama-like mission control desktops (no deaths involved, hopefully).
To get all the fancy stuff up and running, start by installing Termgraph, which is a piece of cake:
$ pip3 install termgraph --user
Once it’s there, just feed it with a data file (some examples are provided on Github):
$ termgraph data/ex4.dat --color {blue,red}
Data files are just plain text files that you can take as templates. They mostly look like CSV or tab-separated lists and tables. However, it’s possible to provide the input data directly via the command line:
$ echo “Label,3,9,1” | termgraph --custom-tick “”
Consequently, you can use any Unicode character or emoji as a tick and spice up your charts .The output of
$ termgraph -h shows the full list of available options. You can add title, labels, set colours and even arrange for the layout to be vertical.
There are many ways to visualise your own data. The easiest one is to edit an existing template by filling it with your own values. If you need just a simple bar graph, try redirecting your CLI experiments to a file:
$ echo “Label,3,9,1” | termgraph > file.dat
You can also produce data files using custom scripts or any software that can handle Csv-like content.