Skip to main content

Escape Dependency Hell โ€” Scan, audit, and fix your Python dependencies in one command.

Project description

๐Ÿ›ก๏ธ depwarden

Escape Dependency Hell โ€” Scan, audit, and fix your Python dependencies in one command.

Python 3.10+ License: MIT

What is depwarden?

depwarden is a CLI tool that scans your Python project's dependencies for:

  • ๐Ÿ”’ Security vulnerabilities โ€” CVE scanning via the OSV.dev database with clickable advisory links
  • ๐Ÿ“ฆ Dependency bloat โ€” how many sub-dependencies each package pulls in
  • ๐Ÿ“Š Health scoring โ€” 0-100 project health rating with letter grades (A-F)
  • ๐Ÿ—‘๏ธ Unused dependencies โ€” packages declared but never imported (project-wide)
  • โ“ Missing dependencies โ€” modules imported but not declared
  • ๐Ÿ’ก Smart suggestions โ€” modern alternatives for common packages
  • ๐Ÿ› ๏ธ Actionable next steps โ€” copy-paste commands to fix every issue
  • ๐Ÿ”— Clickable CVE links โ€” Ctrl+Click vulnerability IDs to open full advisories in your browser

Quick Start

pip install depwarden

# Basic scan (security + bloat)
depwarden scan .

# Full scan (includes unused/missing detection)
depwarden scan . --full

# JSON output for CI/CD pipelines
depwarden scan . --format json

# Fail CI if HIGH+ vulnerabilities found
depwarden scan . --fail-on high

# Exclude specific directories from scanning
depwarden scan . --full --exclude migrations --exclude scripts

Example Output

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ ๐Ÿ›ก๏ธ  depwarden โ€” Escape Dependency Hell โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
  ๐Ÿ“‚ Project: /home/user/myproject
  ๐Ÿ“ฆ Dependencies scanned: 7

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ๐Ÿ“Š Health Score โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚   100 / 100    Grade: A             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

          ๐Ÿ“ฆ Dependency Weight (Top 10)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Package  โ”ƒ Version โ”ƒ Pulls In โ”ƒ Status โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ typer    โ”‚ 0.24.1  โ”‚        7 โ”‚ โœ… OK  โ”‚
โ”‚ httpx    โ”‚ 0.28.1  โ”‚        7 โ”‚ โœ… OK  โ”‚
โ”‚ pydantic โ”‚ 2.12.5  โ”‚        4 โ”‚ โœ… OK  โ”‚
โ”‚ rich     โ”‚ 14.3.3  โ”‚        2 โ”‚ โœ… OK  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

  โœ… No issues found โ€” dependencies are healthy!

Why depwarden?

AI IDEs catch import errors in your editor. depwarden catches dependency health issues in your CI/CD pipeline โ€” where no IDE exists.

Feature pip-audit deptry safety depwarden
CVE scanning โœ… โŒ โœ… โœ…
Clickable CVE links โŒ โŒ โŒ โœ…
Bloat analysis โŒ โŒ โŒ โœ…
Unused detection โŒ โœ… โŒ โœ…
Health score โŒ โŒ โŒ โœ…
Interactive loader โŒ โŒ โŒ โœ…
CVE ignore list โœ… โŒ โŒ โœ…
Free, no API key โœ… โœ… โŒ โœ…

Configuration

depwarden can be configured via pyproject.toml so you don't need to pass flags every time:

[tool.depwarden]
# Directories to exclude from import scanning
exclude = ["tests", "docs", "migrations", "scripts"]

# Automatically fail CI at this severity level
fail_on = "high"

# Whether to include dev dependencies in analysis
include_dev_deps = true

# Packages to ignore in unused dependency detection
# Useful for CLI tools (uvicorn), meta-packages (langchain), or runtime-only deps
ignore_unused = ["uvicorn", "gunicorn", "langchain"]

# Specific vulnerability IDs to ignore (accepted risk)
# Use the exact GHSA/PYSEC/CVE ID shown in the scan output
ignore_vulns = ["PYSEC-2022-43012", "GHSA-r9hx-vwmv-q579"]

Default Excludes

When running --full scans, depwarden automatically skips these directories to avoid false positives from test fixtures and example code:

  • tests/, test/ โ€” test directories
  • docs/ โ€” documentation
  • examples/ โ€” example/demo code
  • benchmarks/ โ€” performance benchmarks
  • scripts/ โ€” utility scripts

You can override these defaults in [tool.depwarden] or add more via --exclude.

CLI Reference

depwarden scan [PATH] [OPTIONS]

Arguments:
  PATH                    Path to the project (default: current dir)

Options:
  --full                  Include unused/missing dependency detection
  --format, -f TEXT       Output format: 'rich' or 'json' (default: rich)
  --fail-on TEXT          Exit code 1 on issues. Values:
                            Security: critical, high, medium, low
                            Quality:  unused, bloat, any
  --no-security           Skip vulnerability scanning (useful offline)
  --no-bloat              Skip bloat analysis
  --exclude, -e TEXT      Directories to exclude (can be repeated)

depwarden version          Show version info

CI/CD Integration

GitHub Actions

name: Dependency Health Check
on: [push, pull_request]

jobs:
  depwarden:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install depwarden
      - run: pip install -r requirements.txt
      - run: depwarden scan . --full --fail-on high

GitLab CI

depwarden:
  stage: test
  image: python:3.12-slim
  script:
    - pip install depwarden
    - pip install -r requirements.txt
    - depwarden scan . --full --fail-on high --format json
  allow_failure: false

Pre-commit Hook

# .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: depwarden
        name: depwarden
        entry: depwarden scan . --fail-on critical
        language: python
        additional_dependencies: [depwarden]
        always_run: true
        pass_filenames: false

Exit Codes

Code Meaning
0 All healthy, no issues
1 Issues found (vulnerabilities, unused deps, etc.)
2 Configuration error (bad path, missing deps file)

How It Works

  1. Reads your pyproject.toml, requirements.txt, or setup.cfg
  2. Queries the OSV.dev database for known CVEs (free, no API key)
  3. Analyzes each dependency's sub-dependency tree for bloat
  4. Scans all .py files using Python's AST to find actual imports (with --full)
  5. Compares declared vs. imported to find unused and missing dependencies
  6. Scores your project 0-100 and outputs a beautiful terminal report or JSON

Interactive Experience

depwarden features a custom loading animation during scans:

[ โ€ข_โ€ข ] Contacting OSV.dev vulnerability database...
[ o_o ] Calculating transitive dependency bloat...
[ O_O ] Parsing Abstract Syntax Trees...
[ -_- ] Finalizing health scores...

Vulnerability IDs in the output are clickable hyperlinks โ€” Ctrl+Click (or Cmd+Click on Mac) any CVE/GHSA ID to open the full advisory in your browser.

Supported Dependency Files

  • pyproject.toml (PEP 621 + Poetry formats, including optional/dev dependencies)
  • requirements.txt (including -r recursive includes)
  • setup.cfg

License

MIT

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

depwarden-0.1.0.tar.gz (4.5 MB view details)

Uploaded Source

Built Distribution

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

depwarden-0.1.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file depwarden-0.1.0.tar.gz.

File metadata

  • Download URL: depwarden-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for depwarden-0.1.0.tar.gz
Algorithm Hash digest
SHA256 40199101fa0935ca15fbac6d74d4f2f6b8e7b8ae7fa8d1b059e2d67a3933c974
MD5 29e35b682ac1b1a87d4b294fe6395e0a
BLAKE2b-256 06eba987dc681aeca4158d400ef9e5a673ddc076754ffe28e88190167ea0db66

See more details on using hashes here.

File details

Details for the file depwarden-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: depwarden-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for depwarden-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33d6cc4736788f99250ee0f26ff2c72a083d598d5c764b2344ac1a2e7ecfea69
MD5 a0952e5fa19e3eb51feb43aaf37fecf6
BLAKE2b-256 a7b8dd1daf0e6b1104beed46427e552061c1d0d18dbd3448ee941c926afda3c8

See more details on using hashes here.

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