Modulegraph2 - Python module dependency graphΒΆ

Modulegraph2 is a library for creating and introspecting the dependency graph between Python modules. The graph is created using static analisys from source and byte code.

The dependency graph contains information about packages, modules, extensions and their dependencies. The dependencies are annotated with relevant information about the import statement.

Modules that from a distribution installed using pip also have a link to information about that distribution.

Release Info

modulegraph 2.3 was released on 2025-11-23. See the changelog for more information.

Release history
Supported Platforms
  • Python 3.10 and later

Installing modulegraph2
$ python3 -mpip \
  install -U modulegraph2