A lightning-fast Python dead code detector written in Rust.
10-50x faster than Vulture. Tree-sitter powered. Zero dependencies.
# Install from crates.io
cargo install pydeadcode
# Analyze your Python code
pydeadcode main.py
Dead Code Found:
main.py: line 42 - unused_function [function] (80% confidence)
main.py: line 89 - DeadClass [class] (80% confidence)
2 dead code items found
10-50x faster than Vulture. Analyze 1000+ lines in ~50ms. Written in Rust for maximum performance.
95%+ accuracy using tree-sitter AST parsing. Smart heuristics minimize false positives.
Recognizes magic methods, decorators, test functions, and entry points automatically.
60-85% confidence levels based on context. Private functions get higher confidence scores.
Single binary, no Python installation needed. Works on Linux, macOS, and Windows.
Color-coded terminal reports with line numbers and confidence levels for easy navigation.
# Install Rust first: https://rustup.rs
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install pydeadcode
cargo install pydeadcode
# Verify installation
pydeadcode --version
# Clone repository
git clone https://github.com/utsav-pal/pydeadcode.git
cd pydeadcode
# Build release version
cargo build --release
# Binary at target/release/pydeadcode
./target/release/pydeadcode --version
# Uninstall pydeadcode
cargo uninstall pydeadcode
# Verify removal
pydeadcode --version
command not found
# Single file
pydeadcode app.py
# Multiple files
pydeadcode file1.py file2.py
# All files in directory
pydeadcode src/**/*.py
# Set confidence threshold
pydeadcode main.py --min-confidence 75
# JSON output for CI/CD
pydeadcode main.py --json > report.json
# Verbose output
pydeadcode main.py --verbose
| Type | Confidence | Example |
|---|---|---|
| Unused Functions | 80% | def unused(): pass |
| Unused Classes | 80% | class UnusedClass: pass |
| Unused Methods | 70% | def method(self): pass |
| Private Unused | 85% | def _private(): pass |
| Decorated Unused | 60% | @decorator |
Benchmark: 1000+ line Python codebase on Intel i7, 16GB RAM
Install PyDeadCode and start cleaning up your Python projects today.