Classify Python modules as dead, fake-alive, standalone, or island — zero dependencies
Project description
dead-scanner
Classify Python modules as dead / fake-alive / standalone / island — zero dependencies.
Extracted from ZEUS ARES Engine SilenceScanner (v3.0).
Install
pip install dead-scanner
Quick Start
# Scan a project
dead-scanner /path/to/your/project
# JSON output
dead-scanner /path/to/project --json
# Scan a single module
dead-scanner /path/to/project -m path/to/file.py
# Quick summary (one line)
python -c "from dead_scanner import SilenceScanner; print(SilenceScanner.quick_check('.'))"
Categories
| Category | Meaning |
|---|---|
| truly_dead | Exported symbols with zero references, not standalone |
| standalone | No imports in, but recognized as CLI/script/migration/build tool |
| structural | __init__.py or API surface files (keep) |
| island | Referenced but missing INTERFACE.md / MODULE.yaml contract |
| fake_alive | Imported by something that is itself a dead end |
Python API
from dead_scanner import SilenceScanner, HealthScorer
# Full scan
scanner = SilenceScanner("/path/to/project")
result = scanner.scan()
print(f"{result['truly_dead_count']} dead, {result['standalone_count']} standalone")
# Quick one-liner
print(SilenceScanner.quick_check("/path/to/project"))
# → "12 dead, 45 standalone, 3 island, 0 fake_alive (534 total modules)"
# Single module
mod = scanner.scan_module("path/to/module.py")
print(mod["status"], mod["unreferenced"])
# Custom standalone patterns
scanner = SilenceScanner(".",
standalone_patterns={
"standalone_script": ["tools/", "scripts/"],
"cli_entry": ["cli.py"],
}
)
# Health scoring
scorer = HealthScorer(".")
scores = scorer.score_module("my_module", in_degree=5, contract_exists=True,
test_exists=True, runtime_calls=100)
print(scores["score"], scores["tier"]) # → 75, "warning"
What makes this different from Vulture?
| Vulture | dead-scanner |
|---|---|
| Finds unused functions/classes | Finds unused modules + classifies them |
| No categorization | 5 categories (dead/standalone/structural/island/fake_alive) |
| No import-graph analysis | Full directed import graph + reverse lookups |
| No contract checking | Detects missing INTERFACE.md contracts |
They complement each other — use Vulture for unused symbols, dead-scanner for unused modules and architecture gaps.
License
MIT — extracted from ZEUS ARES Engine, originally built for the ZEUS Autonomous Trading System.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dead_scanner-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dead_scanner-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffe5503d65b89eb10d0b540d119ed5f5545f2243d324c2e4d34d19f57400f662
|
|
| MD5 |
4ba3ced297211279f2cc06994f5b75b8
|
|
| BLAKE2b-256 |
6a0f2746dee7ccbc99f31b3dd7f9a55a8407a54784a6983c49b93e7b4038d03d
|