Small tools: termgraph
I like small tools on the command line. Tools which do one job well. What I used any now and then is termgraph. It’s a Python library and command line programm ingesting some kind of simple data and plotting different charts in your terminal. He, I’m a self-declared UI-Luddite after all.
Example: I looked up some traffic-congestion
statistics for
Germany
and dumped the table into a flat text file using copy & paste, removed the
German-style thousands separator .
and feed it to termgraph
.
$ cat > stau.csv
2021 850.000
2020 679.000
2019 1.423.000
2018 1.528.000
2017 1.448.000
2016 1.378.000
2015 1.100.000
2014 960.000
2013 830.000
2012 595.000
2011 450.000
2010 400.000
2006 359.000
2002 321.000^D
$ sed 's/\.//g' < stau.csv | termgraph
2021: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 850.00K
2020: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 679.00K
2019: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1.42 M
2018: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1.53 M
2017: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1.45 M
2016: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1.38 M
2015: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 1.10 M
2014: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 960.00K
2013: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 830.00K
2012: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 595.00K
2011: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 450.00K
2010: ▇▇▇▇▇▇▇▇▇▇▇▇▇ 400.00K
2006: ▇▇▇▇▇▇▇▇▇▇▇ 359.00K
2002: ▇▇▇▇▇▇▇▇▇▇ 321.00K
Not sure how you feel about it, but I like it.
P.S. Fri 17 Jun 2022 08:08:45 AM CEST: I just realized that the dips in the years of 2020 & 2021 might be related to the COVID-19 pandemic. Not sure though.