Skip to content

Add Python version of Top Repeaters script and update README#2

Open
nullrouten0 wants to merge 1 commit intomainfrom
codex/analyze-repo-for-top-repeaters-query-logic
Open

Add Python version of Top Repeaters script and update README#2
nullrouten0 wants to merge 1 commit intomainfrom
codex/analyze-repo-for-top-repeaters-query-logic

Conversation

@nullrouten0
Copy link
Copy Markdown
Owner

Motivation

  • Provide a Python CLI equivalent so operators can compute the map's "Top Repeaters" leaderboard outside the Node environment.
  • Make the query logic explicit and reusable in Python while preserving the exact tile-based coverage counting used by the map.

Description

  • Added server/scripts/top-repeaters-from-samples.py, a Python CLI that mirrors the Node script and computes Top Repeaters from GET /get-samples by grouping samples by 6-char geohash tile, deduplicating repeater IDs per tile, counting tile coverage per repeater, and sorting descending.
  • The script supports the same options as the Node tool: --url, --prefix, --limit, and --json and tolerates payload variations by reading name/hash and metadata.path/path/legacy rptr fields.
  • Updated README.md Top Repeaters examples to include python3 scripts/top-repeaters-from-samples.py usage alongside the existing Node commands.

Testing

  • Ran python3 -m py_compile server/scripts/top-repeaters-from-samples.py which succeeded without syntax errors.
  • Ran python3 server/scripts/top-repeaters-from-samples.py --help which printed the CLI help text successfully.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant