{"id":23527,"library":"dead","title":"dead","description":"Dead simple Python dead code detection. Current version 2.1.0 (released 2024-12-08). Checks for unused functions, classes, variables, and imports. Release cadence is irregular, typically a few times a year. Compatible with Python >=3.9.","status":"active","version":"2.1.0","language":"python","source_language":"en","source_url":"https://github.com/asottile/dead","tags":["dead-code","linter","code-quality","python"],"install":[{"cmd":"pip install dead","lang":"bash","label":"Install dead"}],"dependencies":[{"reason":"File pattern matching (gitignore style)","package":"pathspec","optional":false},{"reason":"Optional config file parsing","package":"pyyaml","optional":true},{"reason":"Optional TOML config parsing (Python <3.11)","package":"tomli","optional":true}],"imports":[{"wrong":"from dead import DeadCodeChecker","symbol":"DeadCodeChecker","correct":"from dead import DeadCodeChecker"}],"quickstart":{"code":"# Install: pip install dead\n# Basic usage: dead .\n# Always check file list first:\nimport subprocess\nimport sys\n\n# Run from command line, not import\ncmd = [sys.executable, '-m', 'dead', '--', '.']\nsubprocess.run(cmd, check=True)","lang":"python","description":"Run dead via command line. There is no stable Python API; use subprocess."},"warnings":[{"fix":"Update CLI calls: replace '--exclude' with '--ignore'. Remove any direct Python imports of dead internals.","message":"Version 2.x is a complete rewrite. CLI arguments changed: no more -v/--verbose, --exclude replaced by --ignore. Module structure changed: 'from dead.dead import DeadCodeChecker' no longer works. Direct import of dead from Python is not supported as a library; use subprocess.","severity":"breaking","affected_versions":"1.x -> 2.x"},{"fix":"Use dead as a quick check but complement with mypy's --unused-ignore or pyright's unused expression checks for deeper analysis.","message":"dead only detects *truly unused* symbols in the current project scope. It does not detect unused *exports* intended for external consumers (library code). It may also miss unused symbols behind conditional imports or dynamic access.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace '--min-version' with '--target-version'.","message":"The '--min-version' flag is deprecated in 2.x and will be removed in a future release. Use '--target-version' instead.","severity":"deprecated","affected_versions":"2.0.0+"}],"env_vars":null,"search_vec":"'-08':14 '-12':13 '2.1.0':10 '2024':12 '3.9':36 'cadenc':24 'check':15 'class':19 'code':6,39,42 'code-qu':41 'compat':33 'current':8 'dead':1,2,5,38 'dead-cod':37 'detect':7 'function':18 'import':22 'irregular':26 'linter':40 'python':4,35,44 'qualiti':43 'releas':11,23 'simpl':3 'time':30 'typic':27 'unus':17 'variabl':20 'version':9 'year':32","created_at":"2026-05-01T08:08:15.278492+00:00","updated_at":"2026-05-01T08:08:15.278492+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'DeadCodeChecker' from 'dead' (/tmp/tmp5ewebhh3/venv/lib/python3.12/site-packages/dead.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.1.0","cli_name":"dead","cli_version":"usage: dead [-h] [--files FILES] [--exclude EXCLUDE] [--tests TESTS]","type":"library","homepage":null,"github":"https://github.com/asottile/dead","docs":null,"changelog":null,"pypi":"https://pypi.org/project/dead/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}