I'm looking for a library to draw ASCII graphs (for use in a console) with Python. The graph is quite simple: it's only a flow chart for pipelines.
I saw NetworkX and igraph, but didn't see a way to output to ascii.
Do you have experience in this?
Thanks a lot!
Patrick
EDIT 1:
I actually found a library doing what I need, but it's in perl Graph::Easy . I could call the code from python but I don't like the idea too much... still looking for a python solution :)
When you say 'simple network graph in ascii', do you mean something like this?
.===. .===. .===. .===.
| a |---| b |---| c |---| d |
'===' '===' '---' '==='
I suspect there are probably better ways to display whatever information it is that you have than to try and draw it on the console. If it's just a pipeline, why not just print out:
a-b-c-d
If you're sure this is the route, one thing you could try would be to generate a decent graph using Matplotlib and then post the contents to one of the many image-to-ascii converters you can find on the web.
ascii-plotter might do what you want...
It's not directly Python based, but you should take a look into the artist-mode of emacs
- artist-mode video
- artist-mode site
You can control emacs from python with pymacs, or you can take a look at the lisp code and draw some inspiration.
To draw networks, pydot might be a more convenient solution than matplotlib. It is based on graphviz (gallery).