aryagraph.io.dot.from_dot#
- aryagraph.io.dot.from_dot(text: str, *, dag: bool = False) Graph[source]#
Parse DOT text into a
Graph(graph) orDiGraph(digraph).With dag, a
digraphis returned as aDAG(raisingCycleErroron a cycle). Syntax errors raiseDotSyntaxError(aValueError) with the line and column.>>> g = from_dot('digraph { a -> {b c} [color=red]; b -> c }') >>> sorted(g.edges) [('a', 'b'), ('a', 'c'), ('b', 'c')]