modulegraph
Python module dependency analysis tool
Decision gist · record as of 2026-08-14
Yes, if you need module dependency analysis for build automation or static analysis. The low install friction, permissive license, and lack of known vulnerabilities make it safe to add. However, the aging maintenance status (265 days since last release) and focus on legacy py2app use suggest it is stable but not actively evolving; verify it meets your specific Python version and analysis requirements before relying on it for new tooling.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction installation with only two runtime dependencies (altgraph and setuptools).
- Maintenance status is aging—last release 265 days ago—but the repository remains active with recent commits and no archived status.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
last release 2025-11-22 (265 days) · last repo commit 2026-01-02 · 45 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 114,882 downloads/mo, #12,276 on PyPI
Alternatives
Verify before relying
pip install modulegraph
from modulegraph.modulegraph import ModuleGraph
mg = ModuleGraph()
mg.import_hook('mymodule')
print(mg.nodes())- Whether Python 2.7 support is actively maintained or deprecated in practice despite classifier presence.
- Current state of Python 3.13 and 3.14 support maturity given recent addition in 0.19.7.
- Whether the package is suitable for production use in modern Python tooling or primarily maintained for legacy py2app compatibility.
What it is and what it does
modulegraph is a Python module dependency analyzer that uses bytecode examination and AST parsing to determine which modules import which others, producing a directed graph of dependencies. It extends the standard library's modulefinder with more flexible internal representation, better handling of edge cases (namespace packages, invalid modules, relative imports), and extensibility for custom analysis.
The package is primarily used as a building block in tools that need to understand Python module structure—most notably py2app for creating standalone macOS applications. It handles modern Python versions through 3.14 and maintains backward compatibility with Python 2.7, though recent releases focus on contemporary Python support.
Use it for
- Build tools that need to trace which modules a Python script depends on to bundle or freeze applications.
- Static analysis tools that visualize or report on module dependency graphs within a codebase.
- Linters or auditors checking for circular imports or unintended cross-module dependencies.
- Packaging tools determining which modules to include when distributing a Python application.
- Development environments generating module dependency documentation or diagrams.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need module dependency analysis for build automation or static analysis.
The low install friction, permissive license, and lack of known vulnerabilities make it safe to add. However, the aging maintenance status (265 days since last release) and focus on legacy py2app use suggest it is stable but not actively evolving; verify it meets your specific Python version and analysis requirements before relying on it for new tooling.
Install
modulegraph on PyPI
Before you install
Low friction installation with only two runtime dependencies (altgraph and setuptools). Maintenance status is aging—last release 265 days ago—but the repository remains active with recent commits and no archived status.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
Quickstart
pip install modulegraph
from modulegraph.modulegraph import ModuleGraph
mg = ModuleGraph()
mg.import_hook('mymodule')
print(mg.nodes())
Verify before relying
- Whether Python 2.7 support is actively maintained or deprecated in practice despite classifier presence.
- Current state of Python 3.13 and 3.14 support maturity given recent addition in 0.19.7.
- Whether the package is suitable for production use in modern Python tooling or primarily maintained for legacy py2app compatibility.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesaltgraphsetuptools |
| Maintenance | Aging 265 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 114,882 / month, #12,276 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Build ToolsTopic :: Software Development :: Libraries :: Python Modules |
Evidence: modulegraph-0.19.7-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “python module dependency analysis”
- modulegraphmodulegraph analyzes Python module dependencies by examining bytecode…
- modulegraph2Modulegraph2 builds and introspects a dependency graph of Python…
- grimpGrimp builds a queryable graph of Python package imports, letting you…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also altgraph · grimp · modulegraph2 · pydeps · pyan3 · objgraph · trailmark · objectgraph · depyf · import-deps