Skip to main content

Impulse

https://img.shields.io/pypi/v/impulse.svg Python versions https://github.com/seddonym/impulse/actions/workflows/main.yml/badge.svg https://img.shields.io/badge/License-BSD_2--Clause-orange.svg

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

Graph of django.db.

Installation

  1. 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
Graph of django.db package.

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
Graph of django.db package with 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
Graph of django.db package with 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.

Metadata

Release files for impulse 2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for impulse 2.2
File Size Uploaded
impulse-2.2.tar.gz 209.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for impulse 2.2
File Interpreter ABI Platform
impulse-2.2-py3-none-any.whl Python 3 none any Details

Total release size: 219.7 kB

Release files / impulse-2.2.tar.gz

Download URL impulse-2.2.tar.gz
Size 209.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0a187ec357b870ba813d6a59bd1ca10ea41b2671300f75fe33da02d53619be9c
BLAKE2b-256 checksum
How to use checksums
b138081074e503675159250c0d1c2aa4991f67fc4cdc19c3d498ac658e850955
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 12, 2025.

Transparency log

Release files / impulse-2.2-py3-none-any.whl

Download URL impulse-2.2-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8e2a9367254d73b9363e73076e090bcfb4209876fe5475ce814805ddd0916f3
BLAKE2b-256 checksum
How to use checksums
ea9d9936ec79fe890befe9dc82cb98c4be72742e16a8f8f55107de5f8a7075af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 12, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.2 This release

2 release files

2.1

2 release files

2.0

2 release files

1.2

2 release files

1.1

2 release files

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page