paper-dynasty-card-creation/check_player_names.py
Cal Corum 0a17745389 Run black and ruff across entire codebase
Standardize formatting with black and apply ruff auto-fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:24:33 -05:00

74 lines
2.1 KiB
Python

"""
Check all player names in cardset 27 for asterisks/hash symbols
"""
import asyncio
from db_calls import db_get
CARDSET_ID = 27
async def check_names():
print(f"Fetching all players from cardset {CARDSET_ID}...")
# Get all players from cardset
response = await db_get(
"players", params=[("cardset_id", CARDSET_ID), ("page_size", 500)]
)
if "players" in response:
all_players = response["players"]
elif "results" in response:
all_players = response["results"]
else:
print(f"Error: Unexpected response structure. Response keys: {response.keys()}")
return
print(f"Found {len(all_players)} players\n")
# Check for symbols
players_with_asterisk = []
players_with_hash = []
for player in all_players:
player_id = player["player_id"]
name = player["p_name"]
if "*" in name:
players_with_asterisk.append((player_id, name))
if "#" in name:
players_with_hash.append((player_id, name))
# Report findings
print(f"{'='*60}")
print("RESULTS")
print(f"{'='*60}")
if players_with_asterisk:
print(f"\n⚠️ Found {len(players_with_asterisk)} players with asterisks (*):")
for pid, name in players_with_asterisk[:20]: # Show first 20
print(f" Player {pid}: {name}")
if len(players_with_asterisk) > 20:
print(f" ... and {len(players_with_asterisk) - 20} more")
else:
print("\n✅ No players with asterisks (*) found")
if players_with_hash:
print(f"\n⚠️ Found {len(players_with_hash)} players with hash symbols (#):")
for pid, name in players_with_hash[:20]: # Show first 20
print(f" Player {pid}: {name}")
if len(players_with_hash) > 20:
print(f" ... and {len(players_with_hash) - 20} more")
else:
print("\n✅ No players with hash symbols (#) found")
print(f"\n{'='*60}")
print(
f"Total clean players: {len(all_players) - len(players_with_asterisk) - len(players_with_hash)}/{len(all_players)}"
)
print(f"{'='*60}")
if __name__ == "__main__":
asyncio.run(check_names())