Command line interface for analyzing Python imports.
Project description
Impulse is a command line tool for exploring the imports in a Python package.
Running it will open up the graph in a browser window, along with download links for SVG and PNG.
Screenshot
Installation
Install Impulse using your favorite Python package manager. E.g., with pip:
pip install impulse
2. Ensure the package under test is importable, e.g. by changing your working directory to the one containing the package, or installing it via a Python package manager.
One liner using uv tool
If you use uv you can run it with this one-liner, without needing to install anything.
uv tool run --with=PACKAGE impulse drawgraph MODULE_NAME
Command overview
There is currently only one command.
drawgraph
Usage: impulse drawgraph [OPTIONS] MODULE_NAME
Options:
--show-import-totals Label arrows with the number of imports they
represent.
--show-cycle-breakers Identify a set of dependencies that, if removed,
would make the graph acyclic, and display them as
dashed lines.
--help Show this message and exit.
Draw a graph of the dependencies within any installed Python package or subpackage.
The graph shows the relationship between all the immediate children of the package. An arrow indicates that there is at least one import by the child (or any of its descendants) from the subpackage where the arrow points.
The graph visualization is opened in a browser.
Example
impulse drawgraph django.db
In this example, there is an arrow from .models to .utils. This is because (along with one other import) django.db.models.constraints imports django.db.utils.DEFAULT_DB_ALIAS.
Example with import totals
impulse drawgraph django.db --show-import-totals
Here you can see that there are two imports from modules within django.db.models of modules within django.db.utils.
Example with cycle breakers
impulse drawgraph django.db --show-cycle-breakers
Here you can see that two of the dependencies are shown as a dashed line. If these dependencies were to be removed, the graph would be acyclic. To decide on the cycle breakers, Impulse uses the nominate_cycle_breakers method provided by Grimp.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file impulse-2.2.tar.gz.
File metadata
- Download URL: impulse-2.2.tar.gz
- Upload date:
- Size: 209.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a187ec357b870ba813d6a59bd1ca10ea41b2671300f75fe33da02d53619be9c
|
|
| MD5 |
a8300b3972d8481b4600828481edf659
|
|
| BLAKE2b-256 |
b138081074e503675159250c0d1c2aa4991f67fc4cdc19c3d498ac658e850955
|
Provenance
The following attestation bundles were made for impulse-2.2.tar.gz:
Publisher:
release.yml on seddonym/impulse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
impulse-2.2.tar.gz -
Subject digest:
0a187ec357b870ba813d6a59bd1ca10ea41b2671300f75fe33da02d53619be9c - Sigstore transparency entry: 761670752
- Sigstore integration time:
-
Permalink:
seddonym/impulse@87a63786df65c594525b814981e6c6281fe13941 -
Branch / Tag:
refs/tags/v2.2 - Owner: https://github.com/seddonym
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@87a63786df65c594525b814981e6c6281fe13941 -
Trigger Event:
push
-
Statement type:
File details
Details for the file impulse-2.2-py3-none-any.whl.
File metadata
- Download URL: impulse-2.2-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8e2a9367254d73b9363e73076e090bcfb4209876fe5475ce814805ddd0916f3
|
|
| MD5 |
ce4583961c4830c1de7d78b751f7c673
|
|
| BLAKE2b-256 |
ea9d9936ec79fe890befe9dc82cb98c4be72742e16a8f8f55107de5f8a7075af
|
Provenance
The following attestation bundles were made for impulse-2.2-py3-none-any.whl:
Publisher:
release.yml on seddonym/impulse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
impulse-2.2-py3-none-any.whl -
Subject digest:
c8e2a9367254d73b9363e73076e090bcfb4209876fe5475ce814805ddd0916f3 - Sigstore transparency entry: 761670755
- Sigstore integration time:
-
Permalink:
seddonym/impulse@87a63786df65c594525b814981e6c6281fe13941 -
Branch / Tag:
refs/tags/v2.2 - Owner: https://github.com/seddonym
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@87a63786df65c594525b814981e6c6281fe13941 -
Trigger Event:
push
-
Statement type: