{"id":1780,"library":"vulture","title":"Vulture","description":"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.","status":"active","version":"2.16","language":"en","source_language":"en","source_url":"https://github.com/jendrikseipp/vulture","tags":["static analysis","dead code","linting","code quality","refactoring"],"install":[{"cmd":"pip install vulture","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"Vulture","correct":"from vulture import Vulture"}],"quickstart":{"code":"from vulture import Vulture\n\ncode_string = \"\"\"\ndef my_unused_function():\n    return 42\n\ndef my_used_function():\n    print('Hello')\n\nmy_used_function()\n\"\"\"\n\nv = Vulture()\nv.scan(code_string)\n\nprint(\"Found dead code:\")\nfor item in v.get_unused_code():\n    print(f\"- {item.typ}: {item.name} at {item.filename}:{item.lineno}\")","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher, or pin Vulture to a version less than 2.15.","message":"Vulture versions 2.15 and later require Python 3.9 or newer. Support for Python 3.8 was dropped.","severity":"breaking","affected_versions":">=2.15"},{"fix":"Upgrade your Python environment to 3.8 or higher, or pin Vulture to a version less than 2.10.","message":"Vulture versions 2.10 and later require Python 3.8 or newer. Support for Python 3.7 was dropped.","severity":"breaking","affected_versions":">=2.10, <2.15"},{"fix":"Upgrade your Python environment to 3.7 or higher, or pin Vulture to a version less than 2.9.","message":"Vulture versions 2.9 and later require Python 3.7 or newer. Support for Python 3.6 was dropped.","severity":"breaking","affected_versions":">=2.9, <2.10"},{"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.","message":"Starting 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.","severity":"gotcha","affected_versions":">=2.9"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}