Skip to main content

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.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

termdraw-0.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

termdraw-0.1-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

termdraw-0.1-py2-none-any.whl (25.2 kB view details)

Uploaded Python 2

File details

Details for the file termdraw-0.1.tar.gz.

File metadata

  • Download URL: termdraw-0.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for termdraw-0.1.tar.gz
Algorithm Hash digest
SHA256 1283fc1797858794262b63784385e10700be2329689be5d57d2f81f0dd175dba
MD5 62ec2ac194b5ce0db1c81346af78ede6
BLAKE2b-256 d6006a0cd16d6a7bb9aa2ddb1e0ddd181c8282f2412a872087242b357e6b4ed1

See more details on using hashes here.

File details

Details for the file termdraw-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for termdraw-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a8697f67dc7e7273055b6db4e72599059fed0d1ada7651fc177c1a1a54bbbe8e
MD5 ded2ebb2f3d48c0c01f574f12e4947db
BLAKE2b-256 91a98d676a5baa2a9c3abbe6e4fd8c2447f31a39c3a8094acfb679dd769af84d

See more details on using hashes here.

File details

Details for the file termdraw-0.1-py2-none-any.whl.

File metadata

File hashes

Hashes for termdraw-0.1-py2-none-any.whl
Algorithm Hash digest
SHA256 dc8bdfda0cf77d93e30dc19e3ec8ddec84d38f435286bb9fe4285fc036d753fd
MD5 8264a332f8b541751264526743361ecd
BLAKE2b-256 cb6b058c290aa93e3d99511339445d01b5b8d518d1b0d5ff2cd8be0ff1292f71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page