Skip to main content

Print ASCII graphs in the terminal

Project description

Print ASCII graphs in the terminal.

Risk graph

Installation

The easiest way to install is with pip:

sudo pip install graphscii

To manually install, use:

sudo python ./setup.py install

Usage

To draw a graph, create a Graph object, add nodes and edges, and invoke the draw() method:

from graphscii import Graph

g = Graph()
g.add_node('n0', pos=[0.1, 0.1])
g.add_node('n1', pos=[0.9, 0.1])
g.add_node('n2', pos=[0.5, 0.9])
g.add_edge('n0', 'n1', label='e0')
g.add_edge('n1', 'n2', label='e1')
g.add_edge('n2', 'n0', label='e2')
g.draw()
Simple triangle graph

For more examples, see the examples directory.

Project details


Download files

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

Source Distribution

graphscii-1.0.1.tar.gz (4.3 kB view hashes)

Uploaded Source

Supported by

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