#!/usr/bin/env python3 import sys from collections import Counter from pathlib import Path sys.path.insert(0, str(Path(__file__).parent.parent)) from db_helper import export_topics_to_json topics = export_topics_to_json() print('=== 选题库状态 ===') print(f'总选题数: {len(topics)}') if topics: print(f'字段: {list(topics[0].keys())}') print('\n状态分布:') status_counts = Counter(t.get('status', '<无>') for t in topics) for s, c in sorted(status_counts.items()): print(f' {s}: {c} 个') print('\n各状态详情:') for t in topics: print(f"{t['id']}: {t['title'][:40]:40} | 状态: {t.get('status', '?'):6} | 优先级: {t.get('priority_score', '-')}")