Skip to main content

Python interface to Graphviz

Project description

PyGraphviz is a Python interface to the Graphviz graph layout and visualization package. With PyGraphviz you can create, edit, read, write, and draw graphs using Python to access the Graphviz graph data structure and layout algorithms. PyGraphviz provides a similar programming interface to NetworkX (

Simple example

>>> import pygraphviz as pgv
>>> G = pgv.AGraph()
>>> G.add_node("a")
>>> G.add_edge("b", "c")
>>> print(G)
strict graph "" {
        b -- c;


PyGraphviz requires Graphviz. Please see INSTALL.txt for details.


Released under the 3-Clause BSD license (see LICENSE):

Copyright (C) 2006-2022 PyGraphviz Developers
Aric Hagberg <>
Dan Schult <>
Manos Renieris

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (120.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page