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.2.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.2-py3-none-win_amd64.whl (960.0 kB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

whydep-0.1.2-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.2.tar.gz.

File metadata

  • Download URL: whydep-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 ea04d029c9d5186e77314acee89274b47c58e095939e14b9b1a89cc064d2e230
MD5 c7e315303df7fbb1b6caad638b76ec88
BLAKE2b-256 a65dc0e787fd22fc48357e564d74056d7ebafbbc409d77f5eefdb3a0e0180a6f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: whydep-0.1.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 960.0 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.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f0fbb64a5d8500511832bf0950e6c44de000d8c2b77857e8430d1ba539ff49c7
MD5 0b71cd8f3a5d343759e0f595b4ef3051
BLAKE2b-256 c3ddc7d1f400a1ad20093a0626169d55ee8f0ac1d32d2f158238c523d63f89d6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for whydep-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0575e4a3b6a2ed4fd00b7e56343191392c506bd368707ed113fa7989f0032322
MD5 0af63119f466626ebb543728283b9334
BLAKE2b-256 5eaa459cbda7849310ecd80a26699de53ef20186ce05979ebcacafdfb03f13a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for whydep-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bc3c328b86e6b5c67f7d4c67f3908b7542e70383bbfe83759a3b7ac26ef3f55e
MD5 555342d99437798208d50f72dc1ffd7f
BLAKE2b-256 16cd34b7d22d887982e95515d904b09d3fb88d217169e708a1e52585c129f6e2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for whydep-0.1.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f8f498dec55f0a086e9234c07f8cd098f2fdfc9f880d924988ab2315add1e3c3
MD5 870695e78a1937ee5c89f97b85f849b8
BLAKE2b-256 6b9b15cb972d22896d25206015a6d6d4c293494ce847e452f7dc78545496a46d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for whydep-0.1.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 11b08eeabf3a78214c7277ba5b98c14c1ab9b3212d7d33b6761526c0f461cafb
MD5 2f29e351a0e8b32650ed082f02fabc9a
BLAKE2b-256 0850a3e82c9b50bbaa0251012d36f80b46fdd3aba06bcf3bdac1cdedc6f63d7a

See more details on using hashes here.

Provenance

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