deps-viz
Interactive HTML visualization for Python import dependencies.
Analyzes your code with import_deps and opens an interactive graph in the browser.
Install
pip install deps-viz
# or as a standalone command with uv
uv tool install deps-viz
# or run without installing
uvx deps-viz app tests
Usage
# Analyze and open in browser (writes a temp file in /tmp)
deps-viz app tests
# Write a self-contained HTML file, then open it in your browser
deps-viz app tests -o deps.html
xdg-open deps.html # Linux; macOS: open deps.html
# Read import_deps JSON from stdin
import_deps app --json | deps-viz -o deps.html
You can also drag deps.html into a browser window.
Snap browsers (default Firefox and Chromium on Ubuntu): opening directly
(without -o) fails with "file not found", because snaps have a private /tmp.
Use -o and keep the HTML file somewhere under your home directory.
Input format
deps-viz reads the JSON produced by import_deps --json: a list with one entry per module.
[
{"module": "foo.__init__", "imports": []},
{"module": "foo.foo_a", "imports": ["foo.foo_b", "foo.sub.sub_a"]},
{"module": "foo.foo_b", "imports": []},
{"module": "foo.sub.sub_a", "imports": ["foo.foo_b"]}
]
module: dotted module name. Its package is everything before the last dot (foo.sub.sub_a->foo.sub), used for package colors, filters and collapsing.imports: names of modules it imports. Imports of modules not in the list (stdlib, third-party) are ignored.- Other fields (e.g.
filepath,all_imports) are ignored.
The format is not Python specific: any tool producing this JSON can use deps-viz
(deps-viz -o deps.html < graph.json). import_deps is only used by deps-viz PATH.
Examples
Open in your browser, no install needed:
Source files are in examples/.
Features
- Layout options: Hierarchical (LR/TB) using dagre, or force-directed
- Zoom/pan: Mouse wheel and drag
- Click node: Highlights its imports and importers
- Search: Filter modules by name
- Package filters: Toggle packages on/off (recalculates layout)
- Cycle detection: Circular dependencies highlighted in red
Dependencies
import_deps (no dependencies of its own), used to analyze code with deps-viz PATH.
The HTML loads Cytoscape.js and cytoscape-dagre from CDN.
Related
- import_deps - Analyzes Python import dependencies
Metadata
Release files for deps-viz 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| deps_viz-0.1.0.tar.gz | 51.1 kB | Without provenance | Details for deps_viz-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deps_viz-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for deps_viz-0.1.0-py3-none-any.whl |
Total release size: 64.9 kB
Release files / deps_viz-0.1.0.tar.gz
| Download URL | deps_viz-0.1.0.tar.gz |
|---|---|
| Size | 51.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90a90969d4ea601b21d40e19fc8fa92bc4a44ff083c1430fb93ac2ee544f8acd
|
|
BLAKE2b-256 checksum How to use checksums |
c1c1ae57f6202becf0856919c24f22f411d05e6736a6a8904063ca0181aa9497
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.9
|
Release files / deps_viz-0.1.0-py3-none-any.whl
| Download URL | deps_viz-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e8648398110b4b3cff229e3a2f763b9c4c98c1ad5d98c1ae26899f02ffed537
|
|
BLAKE2b-256 checksum How to use checksums |
2d4bd9b98f568de340bd824ab5d4b5c91c9c1c20a2756b35273df64e9fa30fe4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.9
|
Security for deps-viz 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.