--- id: pyan3 version: "2.6.2" license: GPL-2.0-or-later license_treatment: copyleft maintenance: active --- # pyan3 — Generate approximate call graphs for Python programs License: copyleft · Maintenance: active · Downloads: 204.2K/mo ## What it is and what it does Pyan3 reads Python source files and builds a directed graph of how functions, classes, and modules relate to each other through calls and definitions. Unlike runtime profilers, it performs static analysis by examining code structure rather than executing it, making it useful for understanding architecture without running the code. The tool outputs graphs in multiple formats—GraphViz DOT, yEd, SVG, HTML, or plain text—and supports filtering by depth, direction, and import cycles. It also performs module-level dependency analysis to detect circular imports. The package was recently revived in February 2026 with support for modern Python syntax (walrus operators, match statements, async with, type aliases) across Python 3.10–3.14. It includes a comprehensive test suite and offers both a command-line interface and a Python API for programmatic use. The single runtime dependency is jinja2, keeping the install footprint minimal. Use it for: - Visualize call graphs for code review or documentation by generating SVG diagrams of function relationships. - Detect circular import dependencies at the module level to identify architectural problems. - Generate plain-text call graphs to feed into coding AI agents or documentation systems. - Analyze codebase structure without executing it, useful for security audits or understanding unfamiliar projects. - Control graph detail with depth filtering to create high-level architecture overviews or drill down to specific functions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Pyan3 performs static analysis on Python source code to generate call graphs showing how functions, classes, and modules use each other, with output to GraphViz, yEd, or plain text. Yes, if you need static call-graph visualization or dependency analysis. The package is actively maintained, supports current Python versions, has low install friction, and offers both CLI and API modes. The copyleft GPL-2.0-or-later license is a consideration only if you plan to redistribute derivative code commercially. No known vulnerabilities. ## Install pip install pyan3 uv add pyan3 poetry add pyan3 ## Installing pyan3 Before you install: Low install friction with a single runtime dependency (jinja2). The project is actively maintained as of February 2026, recently revived with modernized analyzer and comprehensive test coverage, supporting Python 3.10–3.14. License in practice: Licensed under GPL-2.0-or-later (copyleft). You may use and modify the package freely, but any derivative work distributed must also be open-source under a compatible GPL license. Quickstart: pip install pyan3 pyan3 src/ --dot --colored --no-defines --concentrate --file output.dot dot -Tsvg output.dot -o output.svg Requires Python 3.10 or later. GraphViz must be installed separately to render DOT output to SVG/PNG. Verify before relying: - Whether the 200+ test suite and 91% branch coverage claim applies to the current 2.6.2 release or is aspirational. - Performance characteristics on large codebases (e.g., thousands of files or deeply nested packages). - Accuracy of static analysis for dynamic imports, eval, or __import__ patterns. ## Package facts - License: GPL-2.0-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 204.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags call graph generator python, static code analysis visualization, python dependency graph, function call relationship mapper, code structure analyzer, import cycle detection, python ast analysis tool, code-analysis, visualization, static-analysis [View on SkillFed](https://skillfed.io/packages/pyan3) · [View on PyPI](https://pypi.org/project/pyan3/)