Graphviz vs PyGraphViz

前端 未结 1 665
醉梦人生
醉梦人生 2021-02-19 15:32

I have some dot files (digraphs) that I need to read in Python and extract some values from the nodes to populate my data structure. I see there are two graphviz packages for Py

1条回答
  •  萌比男神i
    2021-02-19 16:05

    graphviz is lightweight library which calls graphviz as subprocess to execute all actions and produce output. This library is great for quick and easy producing SVG or PNG output.

    pygraphviz is complete C bindings which uses graphviz as library and expose all graphviz internal functionality like add/remove nodes/edges. But it comes with higher complexity in deployment as pip needs to compile C bindings and find all libraries.

    In your case, as you need read and manipulate dot files, it looks like you have to go with pygraphviz. Other interesting alternative to take a look is http://pypi.python.org/pypi/pydot it is pure python dot parser.

    Disclaimer: I am biased, because I contributed (a little bit) to pygraphviz.

    0 讨论(0)
提交回复
热议问题