--- id: pydeps version: "3.0.7" license: BSD-2-Clause license_treatment: permissive maintenance: active --- # pydeps — Display module dependencies License: permissive · Maintenance: active · Downloads: 391.8K/mo ## What it is and what it does pydeps is a command-line tool and Python library that visualizes the dependency structure of Python packages by analyzing import bytecode and generating dependency graphs. It works by inspecting the import opcodes in compiled Python bytecode to discover which modules import which, then renders the result as an SVG or PNG diagram using Graphviz. The tool can highlight circular imports, filter by depth or distance, exclude standard library modules, and organize dependencies into clusters. The package is designed primarily for command-line use but can also be imported and used as a library from Python code. It requires Graphviz to be installed separately on your system. The tool only discovers modules that are actually imported and can be found via Python's import machinery; unimported files in your directory are not included unless you use the `--include-missing` flag. It supports modern Python versions (3.10+) and has been actively maintained since 2014. Use it for: - Identify circular imports in a codebase that may cause initialization problems or refactoring challenges. - Visualize the overall architecture of a large Python project to understand module organization and dependencies. - Generate dependency diagrams for documentation or architecture review presentations. - Detect tightly coupled modules by examining import patterns and suggesting areas for decoupling. - Analyze which external packages your project depends on directly using the `--externals` flag. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Visualizes Python module dependencies as graphs by analyzing import bytecode and generating SVG or PNG diagrams using Graphviz. Yes. pydeps is actively maintained, has low install friction, carries no security vulnerabilities, and solves a clear problem—visualizing Python module dependencies—that is difficult to do manually in large codebases. The permissive BSD-2-Clause license poses no restrictions. The only real prerequisite is having Graphviz installed separately, which is a one-time system setup. ## Install pip install pydeps uv add pydeps poetry add pydeps ## Installing pydeps Before you install: Low friction: pure Python wheel with a single runtime dependency (stdlib_list). Active maintenance with a release 11 days ago and 2106 repository stars. Requires Graphviz to be installed separately on your system for graph rendering. License in practice: BSD-2-Clause is permissive and poses no restrictions on use, modification, or distribution in commercial or private projects. Quickstart: pip install pydeps pydeps mypackage # Generates mypackage.svg showing module dependencies Graphviz must be installed separately and the `dot` command must be on your PATH for graph rendering to work. Verify before relying: - Whether pydeps can handle large codebases (thousands of modules) without performance degradation. - Support for analyzing type hints or static imports beyond bytecode analysis. - Integration with IDEs or CI/CD pipelines beyond command-line usage. ## Package facts - License: BSD-2-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 391.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python module dependency visualization, import graph generator, dependency diagram tool, python import analyzer, module relationship visualization, cyclic import detector, code structure visualization, visualization, code-analysis, dependency-management [View on SkillFed](https://skillfed.io/packages/pydeps) · [View on PyPI](https://pypi.org/project/pydeps/)