--- id: pygraphviz version: "2.0.1" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # pygraphviz — Python interface to Graphviz License: permissive · Maintenance: active · Downloads: 4.3M/mo ## What it is and what it does PyGraphviz is a Python binding to the Graphviz graph layout and visualization toolkit. It lets you construct graphs programmatically, apply Graphviz's sophisticated layout algorithms, and render them to various formats. The package wraps Graphviz's C libraries through compiled extensions, so it requires both the Python package and the underlying Graphviz system library to function. The API mirrors NetworkX's design, making it familiar to developers already working with network libraries. You build graphs by adding nodes and edges, then use Graphviz's algorithms to compute layouts and generate visual output. It's commonly used for network diagrams, dependency graphs, and scientific visualization where automatic layout is valuable. Use it for: - Generate network topology diagrams and system architecture visualizations from Python data structures. - Render dependency graphs for software projects, showing build or import relationships. - Create scientific and mathematical graph visualizations with automatic layout algorithms. - Build flowcharts and state diagrams programmatically from application logic. - Export graph data to multiple formats (PNG, SVG, PDF) for reports and documentation. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyGraphviz provides a Python interface to Graphviz, enabling you to create, edit, read, write, and draw graphs using Graphviz's layout algorithms and visualization engine. Yes, if you need graph visualization with automatic layout. PyGraphviz is actively maintained, has no known vulnerabilities, and offers permissive licensing. The medium install friction (compiled C bindings, system Graphviz dependency) is a real but manageable hurdle; prebuilt wheels for modern Python versions ease deployment. Worth installing for network analysis, diagram generation, and scientific visualization tasks. ## Install pip install pygraphviz uv add pygraphviz poetry add pygraphviz ## Installing pygraphviz Before you install: Medium install friction due to compiled C bindings to the Graphviz library. Prebuilt wheels are available for Python 3.10–3.14 on macOS, Linux, and Windows, but the underlying Graphviz system library must be present. Repository is actively maintained with recent commits. License in practice: Released under BSD-3-Clause (permissive). Binary wheels bundle Graphviz libraries separately licensed under Eclipse Public License v2.0; review the bundled LICENSE.graphviz if that matters for your use case. Quickstart: import pygraphviz as pgv G = pgv.AGraph() G.add_node("a") G.add_edge("b", "c") print(G) Graphviz system library must be installed on your system; PyPI wheels bundle it but your environment must support the compiled C extension. Verify before relying: - Whether Graphviz is automatically available in all wheel distributions or requires separate system installation on some platforms. - Performance characteristics and scalability limits for large graphs. - Compatibility with PyPy beyond the classifier listing. ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 4.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags graph visualization python, graphviz python interface, network graph drawing, graph layout algorithms, create and visualize graphs, graph data structure manipulation, network diagram generation, graph-visualization, network-analysis, graphviz-binding [View on SkillFed](https://skillfed.io/packages/pygraphviz) · [View on PyPI](https://pypi.org/project/pygraphviz/)