Switch roster to 武汉自投投放下单_AM&Media Buy.xlsx

New roster is a strict superset of 投手.xlsx (14 added, none removed, no
reassignments). build_data.py now picks the roster by an explicit
precedence list, so the old 投手.xlsx stays as a fallback.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
FANGKK
2026-09-04 15:33:15 +08:00
co-authored by Claude Opus 5
parent 1746ce0c7f
commit 442aaacc8a
3 changed files with 19 additions and 40 deletions
+9 -5
View File
@@ -30,13 +30,17 @@ books = [(f, openpyxl.load_workbook(f, data_only=True)) for f in SRC_FILES]
# --- 投手花名册 ---
# 优先用独立的 投手.xlsx(月度数据文件已不再带「投手」sheet);
# 没有它时退回到最新一个仍带该 sheet 的月度文件。
ROSTER_XLSX = os.path.join(HERE, '投手.xlsx')
# 花名册候选,按优先级从高到低;命中第一个就用它。
ROSTER_PATTERNS = ['武汉自投投放下单*.xlsx', '投手.xlsx']
roster_file, roster = None, None
if os.path.exists(ROSTER_XLSX):
_rwb = openpyxl.load_workbook(ROSTER_XLSX, data_only=True)
roster_file = ROSTER_XLSX
for pat in ROSTER_PATTERNS:
hits = sorted(glob.glob(os.path.join(HERE, pat)))
if hits:
roster_file = hits[-1]
_rwb = openpyxl.load_workbook(roster_file, data_only=True)
roster = _rwb['投手'] if '投手' in _rwb.sheetnames else _rwb[_rwb.sheetnames[0]]
else:
break
if roster is None:
for f, wb_ in reversed(books):
if '投手' in wb_.sheetnames:
roster_file, roster = f, wb_['投手']
+9 -34
View File
@@ -6,15 +6,15 @@
"date_range": "2026/09/01-2026/09/03",
"note": "投放人以「投手」表 Media Buyer 列为准,@某某 已与某某合并计算;未填写投放人的 Adpingid 不计入;exclude.json 所列包名已排除。Package 后缀为该 Package 花费最高的投放地区,Adpingid 为该地区内花费最高的 Adping。"
},
"grand_total": 13326.0082,
"week34_id_count": 118,
"grand_total": 13334.6102,
"week34_id_count": 123,
"buyers": [
{
"name": "黄政",
"@name": "黄政",
"total": 3988.7022,
"active_ids": 35,
"owned_ids": 137,
"owned_ids": 140,
"pkgs": [
{
"pkg": "com.amazon.mShop.android.shopping",
@@ -57,8 +57,8 @@
"name": "谭超",
"@name": "谭超",
"total": 3188.919,
"active_ids": 23,
"owned_ids": 124,
"active_ids": 25,
"owned_ids": 128,
"pkgs": [
{
"pkg": "asrtum.ent.domovyata",
@@ -146,7 +146,7 @@
"@name": "周梓君",
"total": 2022.3678,
"active_ids": 26,
"owned_ids": 119,
"owned_ids": 121,
"pkgs": [
{
"pkg": "ru.ozon.app.android",
@@ -188,9 +188,9 @@
{
"name": "詹涵粤",
"@name": "詹涵粤",
"total": 1790.1867,
"active_ids": 10,
"owned_ids": 143,
"total": 1798.7887,
"active_ids": 13,
"owned_ids": 146,
"pkgs": [
{
"pkg": "com.king.candycrushsaga",
@@ -235,31 +235,6 @@
"adping": "91556262",
"pkg": "ru.dublgis.dgismobile",
"spend": 11.25
},
{
"adping": "91554853",
"pkg": "com.vuclip.viu",
"spend": 5.702
},
{
"adping": "91557160",
"pkg": "shorts.drama.video",
"spend": 2.4
},
{
"adping": "91557347",
"pkg": "robot.zaimer.ru",
"spend": 0.5
},
{
"adping": "11836152",
"pkg": "com.kwai.bulldog",
"spend": 0.0
},
{
"adping": "11862336",
"pkg": "com.kotak811mobilebankingapp.instantsavingsupiscanandpayrecharge",
"spend": 0.0
}
]
}
Binary file not shown.