Skip to main content

Show why a Python package is installed by tracing its lock file dependency graph

Project description

whydep

Lint Test Bump Release

A fast Rust CLI that answers "why is this Python package installed?" by tracing your project's lock file dependency graph and showing which source files use it.

Install

pip install whydep
# or
uv add --dev whydep

Usage

# Look up a single package
wd certifi
whydep certifi        # same tool, longer alias

# Point at a different project
wd certifi --dir /path/to/my-project

# Scan all direct dependencies for unused ones
wd --find-deprecated

Example output

For a transitive dependency:

Why is 'MarkupSafe' installed?

└── jinja2
    └── flask
        · src/main.py:1: import flask
        · src/main.py:2: from flask import Flask, request
        └── (project root)

For a direct dependency:

Why is 'flask' installed?

· src/main.py:1: import flask
· src/main.py:2: from flask import Flask, request

└── (project root)

If no imports are found for a direct dependency, it is marked as removable:

Why is 'flask' installed?

· (not directly imported — may be aliased or dynamically imported)
(can be removed)

└── (project root)

Lines starting with · show where your code imports the direct dependency that pulled the package in.

--find-deprecated

Scans all direct dependencies and lists those with no imports found in your source files:

Unused direct dependencies (2):

  certifi — no imports found, can be removed
  idna    — no imports found, can be removed

Supported lock files

Tool Lock file
uv uv.lock
Poetry poetry.lock

uv.lock is preferred when both exist. The lock file is searched in the given directory and up to 3 parent directories.

Configuration

Add a [tool.whydep] section to your pyproject.toml to limit source scanning to specific directories (faster, less noise):

[tool.whydep]
src = "src"              # single directory
# src = ["src", "tests"] # or multiple

Without this setting the entire project directory is scanned.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whydep-0.2.1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

whydep-0.2.1-py3-none-win_amd64.whl (959.8 kB view details)

Uploaded Python 3Windows x86-64

whydep-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

whydep-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

whydep-0.2.1-py3-none-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

whydep-0.2.1-py3-none-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file whydep-0.2.1.tar.gz.

File metadata

  • Download URL: whydep-0.2.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for whydep-0.2.1.tar.gz
Algorithm Hash digest
SHA256 891f6dae3c3ac1415256bbc6f32d19f340d64fd0128cb0e93172ffa965f6eec1
MD5 88e5f4d616c6757a26ff6039dc3adf65
BLAKE2b-256 2eb59afa7e15400009e905de4650f6c8933908425eeec5e374fa4b74af17fd3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.2.1.tar.gz:

Publisher: release.yml on colour-white/whydep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whydep-0.2.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: whydep-0.2.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 959.8 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for whydep-0.2.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 72a71559a02869d19cb021add6df2c43e3824ec19366f651ce53fac523fe7cc8
MD5 526465d22cd340e507b39ef221086090
BLAKE2b-256 7c4b12fd4d7bb2bbc6990fc303b238fe5e3f1fd3fb576cb1878e50cac60a7e93

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.2.1-py3-none-win_amd64.whl:

Publisher: release.yml on colour-white/whydep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whydep-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whydep-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6515cd3ba400ddb9010e1af41c07f86c0a7616fb131144776469ee1b039ff376
MD5 39c3c663cc99c05190e2f466154909b9
BLAKE2b-256 d70a8842f115930a5d35d8a831e5cef9f0fb6a5a082132c2bfb24291c27cf871

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on colour-white/whydep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whydep-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for whydep-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f940e2ebf5fb571fe6060fed29368cb1e6dc4250bd033d3fcd234abc2ff93569
MD5 2ccbd199e97416ca1bb3f1981ebace52
BLAKE2b-256 853d8392e9c7d70d0e26197c344f2954a290e0a96607356f98fb040fa6d6e45a

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on colour-white/whydep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whydep-0.2.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for whydep-0.2.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a09982439e51a6759ee9f167dfe79222e903ab5c295ec271f9a953930ac264b6
MD5 0a04e57da9e6a869fb3d03cf9daac769
BLAKE2b-256 4eb9ece372c37b4909797ad6780da5f8299be054cfefab96076d39f1cd194ee3

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.2.1-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on colour-white/whydep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whydep-0.2.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for whydep-0.2.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d638e12babcf745fd38b97cd05d58a0f005348c3722277aadf42fad2238d9e7a
MD5 7f52c7c2e9bc9cc4a58983b750b9ee64
BLAKE2b-256 afeed2a59b382396435624c799fb60c7818e770de3815ff6450b329e125fad12

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.2.1-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on colour-white/whydep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page