--- id: altgraph version: "0.17.5" license: MIT license_treatment: permissive maintenance: aging --- # altgraph — Python graph (network) package License: permissive · Maintenance: aging · Downloads: 12.3M/mo ## What it is and what it does altgraph is a Python graph library descended from graphlib, providing data structures and algorithms for building and analyzing directed and undirected networks. It offers core graph operations—breadth-first and depth-first traversal, topological sorting, shortest-path computation—and can export graphs in graphviz format for visualization. The package has no runtime dependencies and supports Python 2.7 and Python 3.4 through 3.14. The library is primarily used as a dependency in tools like py2app and macholib for analyzing module and binary dependencies. It is stable and widely deployed (over 12 million monthly downloads), though maintenance is aging—the last release was 266 days ago. For straightforward graph construction and traversal tasks, it remains a lightweight, dependency-free choice. Use it for: - Analyze module dependencies in Python applications or build tools - Perform graph traversals and topological sorting on network data - Export graph structures to graphviz for visualization and debugging - Build dependency graphs for build systems or package managers - Compute shortest paths and connectivity in directed networks ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. altgraph constructs and analyzes graphs (networks), supporting BFS and DFS traversals, topological sorting, shortest paths, and graphviz output. Yes. altgraph is a stable, lightweight, zero-dependency library with permissive licensing and no known vulnerabilities. Install it when you need core graph algorithms and traversal operations. The aging maintenance status (last release 266 days ago) is not a blocker for stable use, but monitor the repository if you require active development or new features. ## Install pip install altgraph uv add altgraph poetry add altgraph ## Installing altgraph Before you install: Low install friction with no runtime dependencies. Maintenance status is aging—last release was 266 days ago—but the repository remains active and the package is widely used (top 5000 on PyPI). License in practice: MIT license (permissive) means you can use, modify, and distribute altgraph freely in commercial and private projects with minimal restrictions. Quickstart: pip install altgraph from altgraph.Graph import Graph g = Graph() g.add_node('a') g.add_node('b') g.add_edge('a', 'b') print(g.nodes()) Verify before relying: - Whether graphviz must be installed separately for output functionality to work - Current performance characteristics for large graphs (node/edge scale limits) ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 12.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags graph library python, network analysis traversal, topological sort, shortest path algorithm, graphviz output, bfs dfs graph, directed graph, graph-algorithms, network-analysis, dependency-analysis [View on SkillFed](https://skillfed.io/packages/altgraph) · [View on PyPI](https://pypi.org/project/altgraph/)