A library for computing a module import dependency graph for Python projects (version 2.3). Released irregularly; currently supports Python >=3.10.
pip install modulegraph2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a module graph for 'my_module' in the current directory and prints all nodes.
mg = ModuleGraph(path=['.'], include_stdlib=True, include_site_packages=True)
Ensure Python interpreter version is >= 3.10.
mg = ModuleGraph(path=['.'])
Install modulegraph2 and use 'from modulegraph2 import ModuleGraph'.
Ensure path is a list of strings: mg = ModuleGraph(path=['/path/to/project'])
Upgrade: pip install --upgrade modulegraph2. Then use 'from modulegraph2 import ModuleGraph'.
No dependency data recorded yet.