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
+10 -6
View File
@@ -30,13 +30,17 @@ books = [(f, openpyxl.load_workbook(f, data_only=True)) for f in SRC_FILES]
# --- 投手花名册 --- # --- 投手花名册 ---
# 优先用独立的 投手.xlsx(月度数据文件已不再带「投手」sheet); # 优先用独立的 投手.xlsx(月度数据文件已不再带「投手」sheet);
# 没有它时退回到最新一个仍带该 sheet 的月度文件。 # 没有它时退回到最新一个仍带该 sheet 的月度文件。
ROSTER_XLSX = os.path.join(HERE, '投手.xlsx') # 花名册候选,按优先级从高到低;命中第一个就用它。
ROSTER_PATTERNS = ['武汉自投投放下单*.xlsx', '投手.xlsx']
roster_file, roster = None, None roster_file, roster = None, None
if os.path.exists(ROSTER_XLSX): for pat in ROSTER_PATTERNS:
_rwb = openpyxl.load_workbook(ROSTER_XLSX, data_only=True) hits = sorted(glob.glob(os.path.join(HERE, pat)))
roster_file = ROSTER_XLSX if hits:
roster = _rwb['投手'] if '投手' in _rwb.sheetnames else _rwb[_rwb.sheetnames[0]] roster_file = hits[-1]
else: _rwb = openpyxl.load_workbook(roster_file, data_only=True)
roster = _rwb['投手'] if '投手' in _rwb.sheetnames else _rwb[_rwb.sheetnames[0]]
break
if roster is None:
for f, wb_ in reversed(books): for f, wb_ in reversed(books):
if '投手' in wb_.sheetnames: if '投手' in wb_.sheetnames:
roster_file, roster = f, wb_['投手'] roster_file, roster = f, wb_['投手']
+9 -34
View File
@@ -6,15 +6,15 @@
"date_range": "2026/09/01-2026/09/03", "date_range": "2026/09/01-2026/09/03",
"note": "投放人以「投手」表 Media Buyer 列为准,@某某 已与某某合并计算;未填写投放人的 Adpingid 不计入;exclude.json 所列包名已排除。Package 后缀为该 Package 花费最高的投放地区,Adpingid 为该地区内花费最高的 Adping。" "note": "投放人以「投手」表 Media Buyer 列为准,@某某 已与某某合并计算;未填写投放人的 Adpingid 不计入;exclude.json 所列包名已排除。Package 后缀为该 Package 花费最高的投放地区,Adpingid 为该地区内花费最高的 Adping。"
}, },
"grand_total": 13326.0082, "grand_total": 13334.6102,
"week34_id_count": 118, "week34_id_count": 123,
"buyers": [ "buyers": [
{ {
"name": "黄政", "name": "黄政",
"@name": "黄政", "@name": "黄政",
"total": 3988.7022, "total": 3988.7022,
"active_ids": 35, "active_ids": 35,
"owned_ids": 137, "owned_ids": 140,
"pkgs": [ "pkgs": [
{ {
"pkg": "com.amazon.mShop.android.shopping", "pkg": "com.amazon.mShop.android.shopping",
@@ -57,8 +57,8 @@
"name": "谭超", "name": "谭超",
"@name": "谭超", "@name": "谭超",
"total": 3188.919, "total": 3188.919,
"active_ids": 23, "active_ids": 25,
"owned_ids": 124, "owned_ids": 128,
"pkgs": [ "pkgs": [
{ {
"pkg": "asrtum.ent.domovyata", "pkg": "asrtum.ent.domovyata",
@@ -146,7 +146,7 @@
"@name": "周梓君", "@name": "周梓君",
"total": 2022.3678, "total": 2022.3678,
"active_ids": 26, "active_ids": 26,
"owned_ids": 119, "owned_ids": 121,
"pkgs": [ "pkgs": [
{ {
"pkg": "ru.ozon.app.android", "pkg": "ru.ozon.app.android",
@@ -188,9 +188,9 @@
{ {
"name": "詹涵粤", "name": "詹涵粤",
"@name": "詹涵粤", "@name": "詹涵粤",
"total": 1790.1867, "total": 1798.7887,
"active_ids": 10, "active_ids": 13,
"owned_ids": 143, "owned_ids": 146,
"pkgs": [ "pkgs": [
{ {
"pkg": "com.king.candycrushsaga", "pkg": "com.king.candycrushsaga",
@@ -235,31 +235,6 @@
"adping": "91556262", "adping": "91556262",
"pkg": "ru.dublgis.dgismobile", "pkg": "ru.dublgis.dgismobile",
"spend": 11.25 "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.