Python module dependency analysis tool that builds a directed graph of module dependencies. Current version 0.19.7, maintained by Ronald Oussoren. Releases are irregular, primarily as needed.
pip install modulegraphVerified import paths — ran on the pinned version, not inferred.
Analyze dependencies of a Python script.
Use node.identifier and node.filename (now always a str) instead of node.type or node.filename (could be None).
Replace calls to g.find_modules('script.py') with g.run_script('script.py').Always instantiate a new ModuleGraph() for each independent dependency analysis.
Run 'pip install modulegraph' in your environment.
Use 'run_script' instead: g.run_script('your_script.py').Check if node.filename is not None before using it, or use getattr(node, 'filename', '').