skillfed

pydeps

Display module dependencies

pydeps v3.0.7 391.8K downloads/30d#7,011 on PyPI2,106
Permissive license BSD-2-Clause Active released

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 pydeps

uv

uv add pydeps

poetry

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 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: Libraries :: Python Modules

Tags

python module dependency visualizationimport graph generatordependency diagram toolpython import analyzermodule relationship visualizationcyclic import detectorcode structure visualization
visualizationcode-analysisdependency-management

More Python Modules packages