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.0.tar.gz (16.5 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.0-py3-none-win_amd64.whl (959.8 kB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

whydep-0.2.0-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.0.tar.gz.

File metadata

  • Download URL: whydep-0.2.0.tar.gz
  • Upload date:
  • Size: 16.5 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.0.tar.gz
Algorithm Hash digest
SHA256 906918ba681445b7f9be77db7414957ac4a9f718b6574a755fee10911aeeaf1c
MD5 d8fb57af4ad758068c5d0382bb3cd22a
BLAKE2b-256 6493adf7971a2ecd01ad93ccd696ea397160dcedd181198ba339619a5929179a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: whydep-0.2.0-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.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 63e1273c75366a9e9ef38a615a7b8bfd22104ac9ebd5413e562e03832a984c30
MD5 4a69065924f588b9b364aa20213e2a66
BLAKE2b-256 dc87c25a7808d4f1fa89ecefaa9c8bc798ce0175add609f3a5bcb52abe38a0f2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for whydep-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 39154cfa8748728565c4a8b6df4ad31b6ce8b0007fbf09dac017e44381b3c5ae
MD5 b2a7f24a1b811d8e7314fb01f11548b6
BLAKE2b-256 01716d8d2855ec93ee88088e7b0542c9fbfd91a5dd7d9b5e8206057eda113536

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for whydep-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2cbe9d4c823d30ad66166bb64e2eb11b98da0a4aa1be3823baf75f08ee2211df
MD5 38944b57ea411cfe8b5e9da18accab4d
BLAKE2b-256 9db2cf353c4d5da1a971c7861d58146103ff6639f34f63966d8b541158dd7839

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for whydep-0.2.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0f5943c8100ddcf5f0bb1ce21e054dc6c479d3b530e046bda0f0fa6af49f194a
MD5 a268e49dd2dc1e395114190087a1d37c
BLAKE2b-256 dde13ce470d6e6976cd9fdd185d71144b687729a71576dd223b3b9b3a9b078c7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for whydep-0.2.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 76f18d0106a72067ff16517512b5bd451ab04b74a9b94ddbb97566dbe48d27c6
MD5 287898c2b4ce44bff786a9f87d855758
BLAKE2b-256 d04d50c389e9086116ed675a4d989f20b220ea45bc4996985b38d1445d95fe91

See more details on using hashes here.

Provenance

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