Registry / testing / dead
library2.1.0pypypiunverified

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.

pip install dead
INSTALL
IMPORT
SIG · DEAD
D
dead
testingpythonv2.1.0
Install
1.6s avg
Import
—
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.1.0 · 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.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.6MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

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

DeadCodeChecker
✓ from dead import DeadCodeChecker
✗ from dead import DeadCodeChecker

Run dead via command line. There is no stable Python API; use subprocess.

# Install: pip install dead # Basic usage: dead . # Always check file list first: import subprocess import sys # Run from command line, not import cmd = [sys.executable, '-m', 'dead', '--', '.'] subprocess.run(cmd, check=True)
dead --version
Debug
Known issues
breakingVersion 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.
fix
Update CLI calls: replace '--exclude' with '--ignore'. Remove any direct Python imports of dead internals.
affects: 1.x -> 2.x
gotchadead 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.
fix
Use dead as a quick check but complement with mypy's --unused-ignore or pyright's unused expression checks for deeper analysis.
affects: all
deprecatedThe '--min-version' flag is deprecated in 2.x and will be removed in a future release. Use '--target-version' instead.
fix
Replace '--min-version' with '--target-version'.
affects: 2.0.0+
Upgrade
Version history
2.1.0latest on PyPI · released Feb 8, 2025
Audit
Dependencies
pathspecrequiredFile pattern matching (gitignore style)
pyyamloptionalOptional config file parsing
tomlioptionalOptional TOML config parsing (Python <3.11)
Agent activity
8 hits · last 30 days
node
8
Resources
dead — pip install dead · libregistry