Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Utility library for textual data visualization

Project Description

termdraw - ASCII/Unicode data visualizer

termdraw is a utility written in Python 3 that draws CSV data of form x,y as text graphs.

Usage examples

$ cat data.csv
0,41.492605310851346
1,-61.90512769272529
2,-5.705460535578624
3,-45.40738693881286
4,48.57733683988141
5,-11.09276051450491
6,-48.857646527799886
7,20.02380594874974
8,3.8265498423428568
9,-4.993006692763217
0,17.534954337402368
1,-12.048399887989433
2,-67.66449062064824
3,33.3847844218531
4,36.73010900554392
5,62.315666298226745
6,-59.496317272986865
7,74.93745996536751
8,-7.867224323068683
9,51.88925397139964
$ termdraw data.csv
                      •
                •
            •                •
•        •  •
•                     •
                         •
   •  •         •        •   •

         •         •
   •  •            •

Assume data.csv contains a list of (x,y) points, graph those points, print the result to stdout.

$ termdraw data.csv --width=10 -h 5
       •
•   ••   •
•  ••  ••
 ••  •  ••
 •••  •

Draw graphs with dimensions of 10 characters’ width and height of 5 lines.

$ echo "1,2 2,3 3,4;4,5" | termdraw -
                             •


                   •


         •


•

Read standard input and graph x,y points. Data received via stdin must have the following format: x,y[%Sx,y…], where %S is a separator (a single space or semicolon).

$ echo "1,2 2,3 3,4 4,5" | termdraw - -a
                             o


                   o


         o


o

Only use ASCII symbols in output.

$ termdraw data.csv -s

                ▁     █
            ▂   █     █      ▄
▇        ▃  █   █     █      █
█        █  █   █     █      █
█        █  █   █     █  ▄   █
█  ▄  ▇  █  █   █     █  █   █
█  █  █  █  █   █     █  █   █
█  █  █  █  █   █  ▁  █  █   █
█  █  █  █  █   █  █  █  █   █

Draw a solid graph (fills values at or below the points).

$ termdraw data.csv -si

                ▁     █
            ▂▄▆▇█     █▄     ▄
▇        ▃▅██████    ▃██    ▆█
█▆      ▄████████▆   ████ ▂███
██▅    ▅██████████   ████▄████
███▄▅▆▇███████████▄ ▆█████████
███████████████████ ██████████
███████████████████▁██████████
██████████████████████████████

Draw a graph with linear interpolation between points.

$ termdraw data.csv --print-paths
data.csv
                      •
                •
            •                •
•        •  •
•                     •
                         •
   •  •         •        •   •

         •         •
   •  •            •

Print file paths on a separate line before printing their graphs.

$ termdraw --help
Usage: termdraw.py [options] file.csv
Draw a human-friendly CLI graph with Unicode symbols.

  --help                   Print this help message and exit
  -w X, --width X          Limit graph width to X characters
  -h Y, --height Y         Limit graph height to Y lines
  -i, --interpolate        Enable interpolation
  -n, --no-interpolate     Disable interpolation
  -s, --solid              Draw solid graph (with columns)
  -p, --point              Draw point graph (with points)
  -a, --ascii              Only use ASCII symbols
  -o file, --output file   Write to file instead of stdout
  --print-paths            Print file names before graphs

Print a help message.

Release History

Release History

This version
History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
termdraw-0.1-py2-none-any.whl (25.2 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Jan 21, 2016
termdraw-0.1-py3-none-any.whl (25.2 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Jan 21, 2016
termdraw-0.1.tar.gz (7.6 kB) Copy SHA256 Checksum SHA256 Source Jan 21, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting