Introduction
Introduction Statistics Contact Development Disclaimer Help
Small tools: termgraph
Publishing date: 2022-06-17 07:59 +0200
I like small tools on the command line. Tools which do one
job well. What I used any now and then is termgraph [1].
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 [2] 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: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇�…
2020: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 679.00K
2019: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇�…
2018: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇�…
2017: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇�…
2016: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇�…
2015: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇�…
2014: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇�…
2013: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇�…
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.
[1] Gesamte Staulänge auf Auttobahnen in Dutschland
[2] termgraph
..
___________________________________________________________________
Gophered by Gophernicus/3.1.1 on Raspbian/12 armv7l
You are viewing proxied material from gopher.ynfonatic.de. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.