Skip to content

wrapper over the ascii-graphs library for printing networkx graphs as ASCII.

License

Notifications You must be signed in to change notification settings

cosminbasca/asciinet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asciinet

asciinet is a wrapper over the ascii-graphs library for printing networkx graphs as ASCII.

Important Notes

This software is the product of research carried out at the University of Zurich and comes with no warranty whatsoever. Have fun!

TODO's

  • The project is not documented (yet)

How to Install the Project

First make sure java is installed on your system. To install asciinet follow these instructions:

$ git clone https://github.com/cosminbasca/asciinet
$ cd asciinet/pyasciinet
$ python setup.py install

Also have a look at the build.sh script included in the codebase for a complete setup of the build process

Example

import networkx as nx
from asciinet import graph_to_ascii

#
# create a simple graph
#
G = nx.Graph()
G.add_node(1)
G.add_nodes_from([2, 3, 4])
G.add_edges_from([(1, 2), (1, 3), (3, 4), (1, 4), (2, 4)])

#
# should print
#  ┌───────┐
#  │   1   │
#  └┬────┬┬┘
#   │    ││
#   │    └┼───┐
#   v     v   │
# ┌───┐ ┌───┐ │
# │ 2 │ │ 3 │ │
# └──┬┘ └─┬─┘ │
#    │    │   │
#    │   ┌┼───┘
#    │   ││
#    v   vv
#  ┌───────┐
#  │   4   │
#  └───────┘
#
print graph_to_ascii(G)


Thanks a lot to

About

wrapper over the ascii-graphs library for printing networkx graphs as ASCII.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published