lazyad 0.0.72__tar.gz → 0.0.74__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of lazyad might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazyad
3
- Version: 0.0.72
3
+ Version: 0.0.74
4
4
  Summary: 基于Python的懒人包-适用于广告投放模块
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazyad
6
6
  Author: ZeroSeeker
@@ -362,6 +362,7 @@ def update_ad_batch(
362
362
  ):
363
363
  """
364
364
  暂停广告
365
+ : param operate: 操作:暂停:DISABLE,删除:DELETE
365
366
  :return:
366
367
  """
367
368
  headers = copy.deepcopy(default_headers)
@@ -604,7 +605,8 @@ def get_account_report(
604
605
  conditions: dict = None,
605
606
  kpis: list = None,
606
607
  base_infos: list = None,
607
- time_line: str = "REPORTING_TIME"
608
+ time_line: str = "REPORTING_TIME",
609
+ host: str = "cli2.mobgi.com",
608
610
  ):
609
611
  """
610
612
  推广-广告管理-媒体账户
@@ -625,7 +627,7 @@ def get_account_report(
625
627
  start_date = lazytime.get_date_string(days=0)
626
628
  if not end_date:
627
629
  end_date = lazytime.get_date_string(days=0)
628
- url = "https://cli2.mobgi.com/MainPanelReport/AccountReport/getReport"
630
+ url = f"https://{host}/MainPanelReport/AccountReport/getReport"
629
631
  data = {
630
632
  "data_type": data_type,
631
633
  "media_type": media_type,
@@ -1035,7 +1037,7 @@ def MainPanelReport_AdReport_getReport(
1035
1037
  base_infos: list = None,
1036
1038
  search_field: str = None,
1037
1039
  search_keyword: str = None,
1038
- time_line: str = "REPORTING_TIME",
1040
+ time_line: str = None,
1039
1041
 
1040
1042
  scheme: str = "https",
1041
1043
  host: str = default_host,
@@ -1054,7 +1056,6 @@ def MainPanelReport_AdReport_getReport(
1054
1056
  :param sort_direction: 排序方式,desc:降序
1055
1057
  :param data_type:
1056
1058
  :param conditions: 搜索条件
1057
- :param advertiser_id: 账户id
1058
1059
  :param cdt_start_date: 创建开始时间
1059
1060
  :param cdt_end_date: 创建结束时间
1060
1061
  :param kpis:
@@ -1072,32 +1073,52 @@ def MainPanelReport_AdReport_getReport(
1072
1073
  cdt_end_date = lazytime.get_date_string(days=0)
1073
1074
  if not base_infos:
1074
1075
  base_infos = [
1075
- "adgroup_name",
1076
- "adgroup_id",
1077
- "advertiser_id",
1078
- "company",
1079
- "optimization_goal",
1080
- "system_status",
1081
- "bid_amount",
1082
- "deep_conversion_worth_roi",
1083
- "created_time",
1084
- "user_name",
1085
- "daily_budget",
1086
- "bid_mode",
1087
- "deep_conversion_spec",
1088
- "begin_date"
1089
- ]
1090
- data = {
1091
- "start_date": start_date,
1092
- "end_date": end_date,
1093
- "page": page,
1094
- "page_size": page_size,
1095
- "sort_field": sort_field,
1096
- "sort_direction": sort_direction,
1097
- "data_type": data_type,
1098
- "base_infos": base_infos,
1099
- "time_line": time_line
1100
- }
1076
+ "adgroup_name",
1077
+ "adgroup_id",
1078
+ "advertiser_id",
1079
+ "company",
1080
+ "optimization_goal",
1081
+ "system_status",
1082
+ "bid_amount",
1083
+ "deep_conversion_worth_roi",
1084
+ "created_time",
1085
+ "user_name",
1086
+ "daily_budget",
1087
+ "bid_mode",
1088
+ "deep_conversion_spec",
1089
+ "begin_date"
1090
+ ]
1091
+
1092
+ data = dict()
1093
+
1094
+ # 默认参数
1095
+ if base_infos:
1096
+ data["base_infos"] = base_infos
1097
+ if conditions:
1098
+ data["conditions"] = conditions
1099
+ if data_type:
1100
+ data["data_type"] = data_type
1101
+ if end_date:
1102
+ data["end_date"] = end_date
1103
+ if kpis:
1104
+ data["kpis"] = kpis
1105
+ if media_type:
1106
+ data["media_type"] = media_type
1107
+ if page:
1108
+ data["page"] = page
1109
+ if page_size:
1110
+ data["page_size"] = page_size
1111
+ if sort_direction:
1112
+ data["sort_direction"] = sort_direction
1113
+ if sort_field:
1114
+ data["sort_field"] = sort_field
1115
+ if start_date:
1116
+ data["start_date"] = start_date
1117
+ if time_line:
1118
+ data["time_line"] = time_line
1119
+ if req_source:
1120
+ data["req_source"] = req_source
1121
+
1101
1122
  if media_type == "baidu":
1102
1123
  if not conditions:
1103
1124
  conditions = {
@@ -1114,7 +1135,10 @@ def MainPanelReport_AdReport_getReport(
1114
1135
  if media_account_id:
1115
1136
  conditions["media_account_id"] = [media_account_id]
1116
1137
  data["conditions"] = json.dumps(conditions)
1138
+
1117
1139
  elif media_type in ["gdt_new", "gdt_upgrade"]:
1140
+ if not time_line:
1141
+ time_line = "REPORTING_TIME"
1118
1142
  if not conditions:
1119
1143
  conditions = {
1120
1144
  "is_deleted": "",
@@ -1132,12 +1156,139 @@ def MainPanelReport_AdReport_getReport(
1132
1156
  "time_line": time_line,
1133
1157
  }
1134
1158
  data["conditions"] = json.dumps(conditions)
1135
- if kpis:
1136
- data["kpis"] = kpis
1137
- if req_source:
1138
- data["req_source"] = req_source
1159
+ if time_line:
1160
+ data["time_line"] = time_line
1139
1161
  else:
1140
- return
1162
+ pass
1163
+ headers = copy.deepcopy(default_headers)
1164
+ headers["Cookie"] = cookie
1165
+ return lazyrequests.lazy_requests(
1166
+ method="POST",
1167
+ url=url,
1168
+ json=data,
1169
+ headers=headers
1170
+ )
1171
+
1172
+
1173
+ def MainPanelReport_AccountReport_getReport(
1174
+ cookie: str,
1175
+ media_type: str,
1176
+ sort_field: str,
1177
+ media_account_id: int = None,
1178
+ page: int = 1,
1179
+ page_size: int = 20,
1180
+ start_date: str = None,
1181
+ end_date: str = None,
1182
+ sort_direction: str = "desc",
1183
+ data_type: str = "list",
1184
+ conditions: dict = None,
1185
+ cdt_start_date: str = None,
1186
+ cdt_end_date: str = None,
1187
+ kpis: list = None,
1188
+ req_source: str = None,
1189
+
1190
+ base_infos: list = None,
1191
+ search_field: str = None,
1192
+ search_keyword: str = None,
1193
+ time_line: str = None,
1194
+
1195
+ scheme: str = "https",
1196
+ host: str = default_host,
1197
+ filename: str = "/MainPanelReport/AccountReport/getReport"
1198
+ ):
1199
+ """
1200
+ 推广-广告管理-账户
1201
+ :param cookie:
1202
+ :param media_type:
1203
+ :param media_account_id:
1204
+ :param sort_field: 排序字段
1205
+ :param page:
1206
+ :param page_size:
1207
+ :param start_date: 数据开始日期
1208
+ :param end_date: 数据结束日期
1209
+ :param sort_direction: 排序方式,desc:降序
1210
+ :param data_type:
1211
+ :param conditions: 搜索条件
1212
+ :param cdt_start_date: 创建开始时间
1213
+ :param cdt_end_date: 创建结束时间
1214
+ :param kpis:
1215
+ :param req_source: 腾讯需要的参数
1216
+ :return:
1217
+ """
1218
+ url = f"{scheme}://{host}{filename}"
1219
+ data = dict()
1220
+
1221
+ # 默认参数
1222
+ if base_infos:
1223
+ data["base_infos"] = base_infos
1224
+ if conditions:
1225
+ data["conditions"] = conditions
1226
+ if data_type:
1227
+ data["data_type"] = data_type
1228
+ if end_date:
1229
+ data["end_date"] = end_date
1230
+ if kpis:
1231
+ data["kpis"] = kpis
1232
+ if media_type:
1233
+ data["media_type"] = media_type
1234
+ if page:
1235
+ data["page"] = page
1236
+ if page_size:
1237
+ data["page_size"] = page_size
1238
+ if sort_direction:
1239
+ data["sort_direction"] = sort_direction
1240
+ if sort_field:
1241
+ data["sort_field"] = sort_field
1242
+ if start_date:
1243
+ data["start_date"] = start_date
1244
+ if time_line:
1245
+ data["time_line"] = time_line
1246
+ if req_source:
1247
+ data["req_source"] = req_source
1248
+
1249
+ headers = copy.deepcopy(default_headers)
1250
+ headers["Cookie"] = cookie
1251
+ return lazyrequests.lazy_requests(
1252
+ method="POST",
1253
+ url=url,
1254
+ json=data,
1255
+ headers=headers
1256
+ )
1257
+
1258
+
1259
+ def Advertiser_getRealAdvertiserData(
1260
+ cookie: str,
1261
+ start_date: str = None,
1262
+ end_date: str = None,
1263
+ media_account_ids: list = None,
1264
+ conditions: str = None,
1265
+ scheme: str = "https",
1266
+ host: str = default_host,
1267
+ filename: str = "/Toutiao/Advertiser/getRealAdvertiserData"
1268
+ ):
1269
+ """
1270
+ 推广-广告管理-广告 获取最新的广告数据
1271
+ :param cookie:
1272
+ :param start_date: 数据开始日期
1273
+ :param end_date: 数据结束日期
1274
+ :return:
1275
+ """
1276
+ url = f"{scheme}://{host}{filename}"
1277
+ if not start_date:
1278
+ start_date = lazytime.get_date_string(days=0)
1279
+ if not end_date:
1280
+ end_date = lazytime.get_date_string(days=0)
1281
+
1282
+ if not conditions and media_account_ids:
1283
+ conditions_list = list()
1284
+ for each_media_account_id in media_account_ids:
1285
+ conditions_list.append({"media_account_id": str(each_media_account_id)})
1286
+ conditions = json.dumps(conditions_list)
1287
+ data = {
1288
+ "conditions": conditions,
1289
+ "start_date": start_date,
1290
+ "end_date": end_date
1291
+ }
1141
1292
  headers = copy.deepcopy(default_headers)
1142
1293
  headers["Cookie"] = cookie
1143
1294
  return lazyrequests.lazy_requests(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazyad
3
- Version: 0.0.72
3
+ Version: 0.0.74
4
4
  Summary: 基于Python的懒人包-适用于广告投放模块
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazyad
6
6
  Author: ZeroSeeker
@@ -13,7 +13,7 @@ with open("README.md", "r", encoding='utf-8') as fh:
13
13
 
14
14
  setuptools.setup(
15
15
  name="lazyad",
16
- version="0.0.72",
16
+ version="0.0.74",
17
17
  description="基于Python的懒人包-适用于广告投放模块",
18
18
  long_description=long_description,
19
19
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes