Friday, October 23, 2026

>>> import graphviz
>>> from pathlib import Path
>>> outdir = Path("~").expanduser()
>>> outdir = "."
>>> dot = graphviz.Digraph('foo', format='png', directory=outdir)
>>> dot.node('A', 'King Arthur')
>>> dot.node('B', 'Sir Bedevere the Wise')
>>> dot.node('L', 'Sir Lancelot the Brave')
>>> dot.edges(['AB', 'AL'])
>>> dot.edge('B', 'L') ## , constraint='false')
>>> dot.render()
'foo.gv.png'