Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dead_scanner-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

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

Hashes for dead_scanner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffe5503d65b89eb10d0b540d119ed5f5545f2243d324c2e4d34d19f57400f662
MD5 4ba3ced297211279f2cc06994f5b75b8
BLAKE2b-256 6a0f2746dee7ccbc99f31b3dd7f9a55a8407a54784a6983c49b93e7b4038d03d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page