python-call-graph

Generate Mermaid and JSON call graphs from Python AST analysis.

4|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/oiiiwjh/skills --skill python-call-graph
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-call-graph
Source: https://github.com/oiiiwjh/skills/tree/main/python-call-graph
Command: npx skills add https://github.com/oiiiwjh/skills --skill python-call-graph

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps developers understand the complex relationships and dependencies within Python codebases by generating static call graphs, eliminating the need for manual code tracing or runtime execution.

Core Features & Use Cases

  • Static Analysis: Analyzes Python code using Abstract Syntax Trees (AST) without executing it.
  • Call Graph Generation: Creates visual representations (Mermaid diagrams) and structured data (JSON) of function and method calls.
  • Dependency Mapping: Identifies how different parts of the codebase call each other, aiding in refactoring and debugging.
  • Use Case: When onboarding to a new Python project, use this Skill to generate a call graph of the main application entry point to quickly grasp the project's architecture and data flow.

Quick Start

Use the python-call-graph skill to generate a Mermaid and JSON call graph for the local repository located at '/path/to/your/python/project'.

Frequently Asked Questions about python-call-graph

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a static call graph for a Python repository?

Generate a static call graph for a Python repository by analyzing the codebase using Abstract Syntax Trees (AST) without executing it, producing Mermaid diagrams and JSON data to visualize function dependencies.

How does AST-based dependency analysis work for Python code?

AST-based dependency analysis works by parsing Python code structures into an Abstract Syntax Tree to statically identify function and method calls, mapping out code relationships without runtime execution.

Can I limit the depth of a Python call graph to a specific entrypoint?

Yes, you can limit the depth of a Python call graph and focus the analysis on specific entrypoints, allowing you to visualize a targeted subset of function dependencies rather than the entire codebase.

Does static call graph analysis work with dynamic dispatch in Python?

No, static call graph analysis does not fully support dynamic dispatch and runtime behaviors in Python, as it relies solely on AST parsing rather than executing the code to resolve runtime method calls.

What is the best way to visualize Python code structure for onboarding?

The best way to visualize Python code structure during onboarding is generating a Mermaid diagram of the main application entrypoint, which quickly clarifies project architecture and data flow dependencies.

Can I get JSON output from a Python call graph for downstream processing?

Yes, you can get JSON output from a Python call graph for downstream processing, providing structured data of function and method calls alongside visual Mermaid diagrams for code visualization.