Package: termgraph
TermgraphA command-line tool that draws basic graphs in the terminal, written in Python.Graph types supported:Bar GraphsColor chartsMulti-variableStacked chartsHistogramsHorizontal or VerticalEmoji!Examplestermgraph data/ex1.dat

# Reading data from data/ex1.dat

2007: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 183.32
2008: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 231.23
2009: ▇ 16.43
2010: ▇▇▇▇ 50.21
2011: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 508.97
2012: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 212.05
2014: ▏ 1.00An example using emoji as custom tick:termgraph data/ex1.dat --custom-tick "🏃" --width 20 --title "Running Data"

# Running Data

2007: 🏃🏃🏃🏃🏃🏃🏃 183.32
2008: 🏃🏃🏃🏃🏃🏃🏃🏃🏃 231.23
2009:  16.43
2010: 🏃 50.21
2011: 🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 508.97
2012: 🏃🏃🏃🏃🏃🏃🏃🏃 212.05
2014:  1.00An example using stdin and emoji:echo "Label,3,9,1" | termgraph --custom-tick "😀" --no-label


😀😀😀 3.00
😀😀😀😀😀😀😀😀😀 9.00
😀 1.00Most results can be copied and pasted wherever you like, since they use standard block characters. However the color charts will not show, since they use terminal escape codes for color. A couple images to show color examples:termgraph data/ex4.dat --color {blue,red}termgraph data/ex7.dat --color {yellow,magenta} --stacked --title "Stacked Data"Calendar Heatmap, expects first column to be date in yyyy-mm-ddtermgraph --calendar --start-dt 2017-07-01 data/cal.datInstallRequires Python 3.7+, install fromPyPI projectpython3 -m pip install termgraphNote: Be sure your PATH includes the pypi install directory, for me it is~/.local/bin/UsageCreate data file with two columns either comma or space separated.
The first column is your labels, the second column is a numeric datatermgraph [datafile]Help: termgraph -husage: termgraph.py [-h] [(optional arguments)] [filename]

draw basic graphs on terminal

positional arguments:
  filename              data file name (comma or space separated). Defaults to stdin.

optional arguments:
  -h, --help            show this help message and exit
  --title TITLE         Title of graph
  --width WIDTH         width of graph in characters default:50
  --format FORMAT       format specifier to use.
  --suffix SUFFIX       string to add as a suffix to all data points.
  --no-labels           Do not print the label column
  --no-values           Do not print the values at end
  --space-between       Print a new line after every field
  --color [COLOR ...]   Graph bar color( s )
  --vertical            Vertical graph
  --stacked             Stacked bar graph
  --histogram           Histogram
  --bins BINS           Bins of Histogram
  --different-scale     Categories have different scales.
  --calendar            Calendar Heatmap chart
  --start-dt START_DT   Start date for Calendar chart
  --custom-tick CUSTOM_TICK
                        Custom tick mark, emoji approved
  --delim DELIM         Custom delimiter, default , or space
  --verbose             Verbose output, helpful for debugging
  --label-before        Display the values before the bars
  --version             Display version and exitBackgroundI wanted a quick way to visualize data stored in a simple text file. I initially created some scripts in R that generated graphs but this was a two step process of creating the graph and then opening the generated graph.After seeingcommand-line sparklinesI figured I could do the same thing using block characters for bar charts.ContributeAll contributions are welcome, for feature requests or bug reports, useGithub Issues. Pull requests are welcome to help fix or add features.Code contributions: This repository uses theblack code formatterto automatically format the code. A Github Action is setup to lint your code, to avoid failures it is recommended tosetup your editor to auto format on save.Thanks to all thecontributors!LicenseMIT License, seeLICENSE.txt