vulture
Find dead code
What it is and what it does
Vulture performs static analysis on Python source code to identify unused functions, classes, methods, variables, imports, and unreachable code blocks. It assigns confidence scores (60–100%) to each finding to indicate how certain it is that the code is genuinely dead, helping developers distinguish between high-confidence dead code and potential false positives that may result from Python's dynamic nature.
The tool is designed for code cleanup and quality improvement in large codebases. It can be run as a command-line tool on individual files or entire directories, integrated into pre-commit hooks, or used programmatically via its Python API. Configuration is supported through pyproject.toml, and false positives can be managed through whitelists, exclusion patterns, decorator ignoring, and name-matching rules.
Use it for:
- Clean up large codebases by identifying and removing unused functions and classes that accumulate over time
- Find untested code by running Vulture on both library and test suite to detect code paths not covered by tests
- Detect unreachable code blocks and dead imports that may indicate logic errors or incomplete refactoring
- Integrate into CI/CD pipelines via pre-commit hooks to prevent dead code from being committed to repositories
- Suppress known false positives in dynamic code using whitelists and configuration rules
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Vulture is a static code analyzer that finds unused code in Python programs by scanning for dead functions, classes, variables, imports, and unreachable code blocks.
Yes. Vulture is a mature, actively maintained tool with no known vulnerabilities, low install friction, and permissive MIT licensing. It fills a genuine need in code quality workflows—static analysis alone cannot catch all dead code due to Python's dynamic nature, but Vulture's confidence scoring and false-positive suppression mechanisms make it practical for real projects.
Install
vulture on PyPI
pip
pip install vultureuv
uv add vulturepoetry
poetry add vultureInstalling vulture
Before you install
Low friction install with a single lightweight dependency (tomli). The project is actively maintained with recent releases and supports Python 3.9 through 3.14.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and commercial projects.
Quickstart
pip install vulture
vulture myscript.py
vulture myscript.py --min-confidence 100
Verify before relying
- Accuracy of confidence scoring for different code types and whether 60–100% ranges hold across diverse codebases
- Performance characteristics on very large codebases and whether static analysis speed scales linearly
Package facts
| License | The MIT License (MIT) Copyright (c) 2012-2020 Jendrik Seipp (jendrikseipp@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — tomli |
| Maintenance | actively maintained — 142 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,204,416/month — #1,410 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: vulture-2.16-py3-none-any.whl
Keywords: dead, code, removal
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
deadcodeScans Python codebases to find and optionally…
agpl · top 15,000 on PyPI
uncalledDetects unused functions in Python projects…
permissive · top 15,000 on PyPI
refurbRefurb is a static analysis tool that scans…
copyleft · top 15,000 on PyPI
eradicateEradicate detects and removes commented-out…
permissive · top 5,000 on PyPI
flake8-eradicateA flake8 plugin that detects commented-out code…
permissive · top 15,000 on PyPI
pytest-deadfixturesA pytest plugin that identifies unused and…
permissive · top 5,000 on PyPI
autoflakeautoflake removes unused imports and unused…
permissive · top 5,000 on PyPI
pytest-unused-fixturesA pytest plugin that identifies and reports…
permissive · top 15,000 on PyPI
flake8-unused-argumentsA flake8 plugin that detects unused function…
permissive · top 15,000 on PyPI
yesqayesqa automatically removes unnecessary `#…
permissive · top 15,000 on PyPI