Skip to content

refactor: split monolithic rugguard.py into rugguard/ package#51

Merged
codegraphtheory merged 1 commit into
mainfrom
refactor/package-structure
Jun 4, 2026
Merged

refactor: split monolithic rugguard.py into rugguard/ package#51
codegraphtheory merged 1 commit into
mainfrom
refactor/package-structure

Conversation

@codegraphtheory

Copy link
Copy Markdown
Owner

Description

Inspired by @a11ce's PR #50. This refactors the monolithic scripts/rugguard.py (~2400 lines) into a proper Python package with 8 focused modules, preserving ALL current features.

New structure:

rugguard/
  rpc.py          JSON-RPC client, caching, concurrency controls
  onchain.py      On-chain fetchers (holders, LP, metadata)
  scoring.py      RugFlags, RugScore, scoring engine (13 components)
  analysis.py     rug_check_token pipeline, rug_check_wallet
  formatting.py   Markdown, JSON, CSV/JSONL export, sparkline, badge,
                  comparison table, timeline
  watch.py        SQLite history, webhooks, cli_watch
  cli.py          CLI dispatch, main(), all commands
  __init__.py     Public API re-exports
scripts/
  solana-rug.py   CLI launcher (no install needed)

All 43 tests pass. Ruff clean. Zero regressions.

@a11ce thank you for the refactoring idea and the structural blueprint. Please post your Solana wallet address for a 500,000 $RUG bounty.

Splits scripts/rugguard.py (~2400 lines) into a proper Python package:

rugguard/
  rpc.py          JSON-RPC client, caching, concurrency controls
  onchain.py      On-chain fetchers (holders, LP, metadata, DexScreener)
  scoring.py      RugFlags, RugScore, scoring engine (13 components)
  analysis.py     rug_check_token pipeline, rug_check_wallet, ProgressBar
  formatting.py   Markdown, JSON, CSV, JSONL export, sparkline, badge,
                  comparison table, timeline, SVG
  watch.py        SQLite history, webhooks, cli_watch
  cli.py          CLI dispatch, main(), all CLI commands
  __init__.py     Public API re-exports

scripts/
  solana-rug.py   Standalone CLI launcher (no pip install needed)

All 43 tests pass. All features preserved: export CSV/JSONL, compare,
badge, timeline, telegram bot, docker, concurrent wallet scan, sparkline,
granular liquidity scoring, Token-2022 GPA fallback, sniper detection.

Co-authored-by: a11ce <a11ce@users.noreply.github.com>
@codegraphtheory codegraphtheory merged commit 535b66c into main Jun 4, 2026
3 checks passed
@codegraphtheory codegraphtheory deleted the refactor/package-structure branch June 4, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant