skip to navigation
skip to content

Not Logged In

viz 0.0.5

Data visualization in the terminal

Data visualization in the terminal.

Install

From PyPI:

easy_install viz

From source:

git clone https://github.com/chbrown/viz.git
cd viz
python setup.py install

The CLI entry point is viz, which should be installed on your PATH.

Commands

viz hist

Read floats from stdin and plot as a single line histogram.

Example: ping google every 100ms (0.1s) and plot the first 50 response times you get back:

ping -i 0.1 google.com | head -50 | sed -n 's/.*time=\(.*\) ms/\1/p' | viz hist

Example result (which should fit your terminal width automatically):

26.1390000[▁      ▁▁  ▁▁▂▂ ▉ ▂▂ ▃ ▂▁▂ ▁ ▁▁      ▁   ▁                                    ]39.5580000

viz total

Read floats from stdin and sum them. No graphics, but useful because awk '{sum+=$1}END{print sum} is too long.

Example: count the bytes used by the current directory and its children.

find . -ls | tr -s ' ' | cut -d ' ' -f 7 | viz total

Example result:

8519086.0

Compare to du:

echo $[$(du -sk . | cut -f 1) * 1024]
> 8531968

viz points

Read floats from stdin, plot on a single line from left to right with as much granularity as the terminal will allow. Otherwise, bin incrementally and plot the arithmetic mean of each bin.

Example: ping some really awful website every 100ms, plot the first 100 successful responses (takes about 10s).

ping -i 0.1 godaddy.com | head -100 | sed -n 's/.*time=\(.*\) ms/\1/p' | viz points

Example result:

[+156.298000]
   ▃▃ ▁▃          ▁ ▁▁ ▁    ▁  ▁▁▁▂ ▃▂ ▉▂              ▁ ▁▁      ▁▂▁       ▁  ▁          ▁      ▁
[+70.593000]

The top line is the maximum, the bottom is the minimum. The other values are scaled linearly between those extremes.

Dependencies:

  • numpy

License

Copyright (c) 2013 Christopher Brown. MIT Licensed.

 
File Type Py Version Uploaded on Size
viz-0.0.5.tar.gz (md5) Source 2014-01-18 7KB
  • Downloads (All Versions):
  • 11 downloads in the last day
  • 86 downloads in the last week
  • 367 downloads in the last month
  • Author: Christopher Brown
  • Home Page: https://github.com/chbrown/viz
  • Keywords: console terminal data visualization plot histogram
  • License:
    Copyright (c) 2013 Christopher Brown
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
  • Categories
  • Package Index Owner: chbrown
  • DOAP record: viz-0.0.5.xml