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 vultureVerified import paths — ran on the pinned version, not inferred.
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.
Upgrade your Python environment to 3.9 or higher, or pin Vulture to a version less than 2.15.
Upgrade your Python environment to 3.8 or higher, or pin Vulture to a version less than 2.10.
Upgrade your Python environment to 3.7 or higher, or pin Vulture to a version less than 2.9.
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.
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.
Install the package using `pip install vulture` in the correct Python environment.
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.
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.
No dependency data recorded yet.