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.1.3.tar.gz (16.4 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.1.3-py3-none-win_amd64.whl (959.9 kB view details)

Uploaded Python 3Windows x86-64

whydep-0.1.3-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.1.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

whydep-0.1.3-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.1.3.tar.gz.

File metadata

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

File hashes

Hashes for whydep-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9a7358eda929eb41dc5c80fe8324a4677223b8ef5ccde4204aa4d89f84893ee6
MD5 a89fc50a4973093ca3ef6592316fd9fd
BLAKE2b-256 01a250d06709146470f0f657749c6c1572a568aa88212c215b45bf258cc910a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.1.3.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.1.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: whydep-0.1.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 959.9 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.1.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 33c9140a230e996472387cc305565452b7698e4aa4becbedb61bb0d881c284c6
MD5 8edbed78da6e6fd8b053f826abdef6eb
BLAKE2b-256 b6c27465e7f14070a282a3e865ab3cb62b60c92ae18e277c9346e47d9669b223

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.1.3-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.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whydep-0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09c8f0ef67973493bfd3c5681fe5b1b2aab19eed3704fb541999e58a73d1c8e3
MD5 4f653266a0bd3b70dcf80c8129d5b144
BLAKE2b-256 b3f620e77e65f3e51cb603b126ee0d1b8335a763b6c53965e3009b469b05e65e

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.1.3-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.1.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for whydep-0.1.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ac9d06d981d99f5757867ab75562daa78af9f5fdd824650d78338a769b4bafe4
MD5 d016e5a157b78f79175c195de738a952
BLAKE2b-256 7c7bd38a39e793432d2cb6590195e631df9e7b6f484b6e9d8ffe5ad0b56ff4f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.1.3-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.1.3-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for whydep-0.1.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e5f7417e632be3e1c8407499dca45d08b077ccdaad84a4fd76c1e580273da962
MD5 686ce7efe12add299baa275612e677c9
BLAKE2b-256 858cdc20168eaf25867268f9f557775ae66558802bb471e70b56732d8d92b86f

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.1.3-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.1.3-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for whydep-0.1.3-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9d2a320acd9842b0b3fe77e38585f8f7cdf98bf6fffd9353cccd37442bde053b
MD5 425c88d52ea3173309368badcd78e114
BLAKE2b-256 12f2b40f352eb9e90b63a60d9772dfab29ee34f5fa688253dd2f0ead40d4bcc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for whydep-0.1.3-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