Registry / testing / vulture

vulture

JSON →
library2.16pypypi✓ verified 26d ago

Vulture is a Python library and command-line tool designed to find dead code in Python programs. It analyzes your code for unused functions, classes, methods, and variables by building an abstract syntax tree (AST) and then performing reachability analysis. Currently at version 2.16, it maintains an active development cycle with several releases per year, incorporating new Python version support and bug fixes.

pip install vulture
INSTALL
IMPORT
SIG · VULTURE
V
vulture
testingpythonv2.16
Install
1.6s avg
Import
58ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.16 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.062s · 18.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.054s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Vulture
from vulture import Vulture

Initialize Vulture and scan a code string or files to find unused code. The `get_unused_code()` method returns an iterator of `Item` objects, each representing a piece of dead code.

from vulture import Vulture code_string = """ def my_unused_function(): return 42 def my_used_function(): print('Hello') my_used_function() """ v = Vulture() v.scan(code_string) print("Found dead code:") for item in v.get_unused_code(): print(f"- {item.typ}: {item.name} at {item.filename}:{item.lineno}")
vulture --version
Debug
Known issues
breakingVulture versions 2.15 and later require Python 3.9 or newer. Support for Python 3.8 was dropped.
fix
Upgrade your Python environment to 3.9 or higher, or pin Vulture to a version less than 2.15.
affects: >=2.15
breakingVulture versions 2.10 and later require Python 3.8 or newer. Support for Python 3.7 was dropped.
fix
Upgrade your Python environment to 3.8 or higher, or pin Vulture to a version less than 2.10.
affects: >=2.10, <2.15
breakingVulture versions 2.9 and later require Python 3.7 or newer. Support for Python 3.6 was dropped.
fix
Upgrade your Python environment to 3.7 or higher, or pin Vulture to a version less than 2.9.
affects: >=2.9, <2.10
gotchaStarting from version 2.9, the `vulture` command-line tool exits with code 3 if dead code is found. Previously, it would exit with code 0 regardless of whether dead code was found, making it harder to use in CI/CD pipelines.
fix
Update CI/CD scripts to check for an exit code of 3 to indicate the presence of dead code. For programmatic use, inspect the `get_unused_code()` result directly.
affects: >=2.9
Errors
Common errors & fixes
vulture: command not found
The `vulture` executable is not in your system's PATH, typically because it was not installed or the virtual environment containing it is not active.
fix
Ensure `vulture` is installed globally or in your active virtual environment by running `pip install vulture`. If already installed in a virtual environment, activate it.
ModuleNotFoundError: No module named 'vulture'
The `vulture` Python package is not installed in the Python environment currently being used by your script or interpreter.
fix
Install the package using `pip install vulture` in the correct Python environment.
Vulture found 0 dead items (0% dead code).
`vulture` might not be analyzing the intended files due to incorrect directory specification, files being explicitly excluded, or the actual absence of dead code.
fix
Run `vulture` from your project's root directory or explicitly provide the path to the target directory (e.g., `vulture .` or `vulture my_project/`). Review your `.vulture` configuration file or `--exclude` arguments for unintended exclusions.
vulture: error: my_script.py: No such file or directory
The file or directory path provided to `vulture` does not exist or `vulture` lacks the necessary permissions to access it.
fix
Verify the accuracy of the path provided in the command (e.g., `vulture my_project/my_module.py`) and ensure it points to an existing and accessible file or directory.
Upgrade
Version history
2.16latest on PyPI · released Mar 25, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
14
Resources
vulture — pip install vulture · libregistry