pydeps
Display module dependencies
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 on this page — 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
pydeps on PyPI
pip
pip install pydepsuv
uv add pydepspoetry
poetry add pydepsInstalling 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 the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — stdlib_list |
| Maintenance | actively maintained — 11 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 391,797/month — #7,011 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pydeps-3.0.7-py3-none-any.whl
Keywords: Python, Module, Dependency, graphs
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pipdeptreepipdeptree displays installed Python packages…
permissive · top 5,000 on PyPI
py-import-cyclesDetects import cycles in Python projects by…
permissive · top 15,000 on PyPI
pyan3Pyan3 performs static analysis on Python source…
copyleft · top 15,000 on PyPI
modulegraphmodulegraph analyzes Python module dependencies…
permissive · top 15,000 on PyPI
pydotpydot is a Python interface to Graphviz that…
permissive · top 1,000 on PyPI
importlabImportlab infers Python import dependencies and…
permissive · top 5,000 on PyPI
grimpGrimp builds a queryable graph of Python…
permissive · top 5,000 on PyPI
cyclicDetects and reports cyclic relationships in a…
permissive · top 15,000 on PyPI
mo-importsProvides patterns to resolve circular module…
copyleft · top 15,000 on PyPI
import-depsAnalyzes Python module imports statically using…
permissive · top 5,000 on PyPI