{"library":"pygraphviz","title":"PyGraphviz","description":"PyGraphviz is a Python interface to the Graphviz graph layout and visualization package. It enables users to create, edit, read, write, and draw graphs using Python by accessing Graphviz's graph data structure and layout algorithms. It offers a programming interface similar to NetworkX. The current stable version is 1.14, with minor releases typically occurring a few times a year, alongside less frequent major version updates.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install pygraphviz"],"cli":null},"imports":["from pygraphviz import AGraph"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pygraphviz as pgv\n\n# Create a directed graph\nG = pgv.AGraph(directed=True, strict=False)\n\n# Add nodes\nG.add_node('A', shape='box', color='red')\nG.add_node('B', shape='circle')\nG.add_node('C', label='Node C')\n\n# Add edges\nG.add_edge('A', 'B', label='connects', penwidth=2)\nG.add_edge('B', 'C', color='blue', style='dashed')\nG.add_edge('C', 'A')\n\n# Set graph attributes\nG.graph_attr['label'] = 'My Sample Graph'\nG.graph_attr['overlap'] = 'false'\nG.graph_attr['splines'] = 'true'\n\n# Layout the graph (using dot engine by default)\n# and draw to a file\nG.layout(prog='dot')\noutput_filename = 'sample_graph.png'\nG.draw(output_filename)\n\nprint(f\"Graph saved to {output_filename}\")\n# print(G) # Uncomment to see the DOT language representation","lang":"python","description":"This quickstart demonstrates how to create a directed graph, add nodes and edges with attributes, set global graph attributes, lay out the graph using a specified engine (e.g., 'dot'), and render it to a PNG image file.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":null,"pypi_latest":"1.14","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pygraphviz","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pygraphviz","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.2,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pygraphviz","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pygraphviz","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.1,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pygraphviz","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pygraphviz","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pygraphviz","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pygraphviz","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.8,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pygraphviz","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pygraphviz","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.6,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}