lazyad 0.0.70__tar.gz → 0.0.72__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.70
3
+ Version: 0.0.72
4
4
  Summary: 基于Python的懒人包-适用于广告投放模块
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazyad
6
6
  Author: ZeroSeeker
@@ -284,6 +284,7 @@ def performance(
284
284
  timeout=timeout
285
285
  )
286
286
 
287
+
287
288
  def sanitize_entities(
288
289
  xml_content
289
290
  ):
@@ -381,3 +382,134 @@ def history(
381
382
  url=url,
382
383
  headers=headers
383
384
  )
385
+
386
+
387
+ def reports(
388
+ cookie: str,
389
+ url_filename: str,
390
+ total: bool = False,
391
+
392
+ page: int = 1,
393
+ page_size: int = 50,
394
+ timezone: int = 8,
395
+ start_time: str = None,
396
+ end_time: str = None,
397
+ show_calendar_day: int = 2,
398
+ breakdowns: list = None,
399
+ metrics: list = None,
400
+ sort: str = None,
401
+ order: str = "DESC",
402
+ adv_campaign_id: int = None,
403
+ promote_country_code: str = None,
404
+ timeout: int = default_timeout,
405
+ stream: bool = False,
406
+
407
+ ):
408
+ """
409
+ 获取 报表中心报表
410
+ 需要登录:{'code': 400, 'msg': 'Please login first', 'data': None}
411
+ 验证成功:{'code': 200, 'msg': 'success', 'data': {}
412
+ :param cookie: 已经登陆的cookie
413
+ :param url_filename: 具体地址,例如:/api/v1/reports/creative
414
+
415
+ :param total: 为True时获取总记录数
416
+ :param export: 为True时下载表格文件
417
+ :param page: 页码
418
+ :param page_size: 每页数量
419
+ :param timezone: 时区
420
+ :param start_time: 开始日期,例如:2025-03-05
421
+ :param end_time: 结束日期,例如:2025-03-05
422
+ :param show_calendar_day:
423
+ :param breakdowns: 分组依据(高级选项):[]
424
+ (date:天, timestamp:小时,week:周,month:月)
425
+ adv_offer_id:广告单元,
426
+ bid_type:Bid Type,
427
+ country_code:国家或地区
428
+ app:应用id(子渠道)
429
+ package_name:包名(子渠道)
430
+ app_name:应用名称(子渠道)
431
+ adv_campaign_id:广告
432
+ received_price:单价
433
+ ad_type:广告类型
434
+ :param metrics: 展示数据列(高级选项):[]
435
+ "adv_impression", # 展示
436
+ "adv_click", # 点击
437
+ "adv_install", # 转化
438
+ "ecpm", # eCPM
439
+ "ecpc", # CPC
440
+ "ecpi", # eCPI
441
+ "ctr", # CTR
442
+ "ivr", # IVR
443
+ "cvr", # CVR
444
+ "adv_original_money", # 花费
445
+ "iaa_d0_ad_revenue", # D0 Ad Rev
446
+ "iaa_d0_roas", # D0 Ad Roas
447
+ "iaa_d3_ad_revenue", # D3 Ad Rev
448
+ "iaa_d3_roas", # D3 Ad Roas
449
+ "iaa_d7_ad_revenue", # D7 Ad Rev
450
+ "iaa_d7_roas", # D7 Ad Roas
451
+ "iap_d0_ad_revenue", # D0 IAP Rev
452
+ "iap_d0_roas", # D0 IAP Roas
453
+ "iap_d3_ad_revenue", # D3 IAP Rev
454
+ "iap_d3_roas", # D3 IAP Roas
455
+ "iap_d7_ad_revenue", # D7 IAP Rev
456
+ "iap_d7_roas", # D7 IAP Roas
457
+ :param sort: [可选-排序] 排序依据(高级选项):adv_install:转化
458
+ :param order:
459
+ :param adv_campaign_id: [可选-筛选]广告名称
460
+ :param promote_country_code: [可选-筛选]投放区域
461
+ :param timeout: 超时时间
462
+ :param stream: 为True时为流式下载
463
+ """
464
+ scheme = "https"
465
+ host = "ss-api.mintegral.com"
466
+
467
+ if not start_time:
468
+ start_time = lazytime.get_date_string(days=0)
469
+ if not end_time:
470
+ end_time = lazytime.get_date_string(days=0)
471
+ if not breakdowns: # 数据维度
472
+ breakdowns = [
473
+ "date",
474
+ "adv_offer_id"
475
+ ]
476
+ if not metrics: # 数据指标
477
+ metrics = [
478
+ "adv_impression", # 展示
479
+ "adv_click", # 点击
480
+ "adv_install", # 转化
481
+ "ecpm", # eCPM
482
+ "ecpc", # CPC
483
+ "ecpi", # eCPI
484
+ "ctr", # CTR
485
+ "ivr", # IVR
486
+ "cvr", # CVR
487
+ "adv_original_money", # 花费
488
+ "iaa_d0_ad_revenue", # D0 Ad Rev
489
+ "iaa_d0_roas", # D0 Ad Roas
490
+ ]
491
+ params = {
492
+ "limit": page_size,
493
+ "page": page,
494
+ "timezone": timezone,
495
+ "start_time": start_time,
496
+ "end_time": end_time,
497
+ "order": order, # 排序
498
+ "breakdowns": ",".join(breakdowns),
499
+ "metrics": ",".join(metrics),
500
+ "show_calendar_day": show_calendar_day
501
+ }
502
+ if sort:
503
+ params["sort"] = sort
504
+ if adv_campaign_id:
505
+ params["adv_campaign_id"] = adv_campaign_id
506
+ headers = copy.deepcopy(default_headers)
507
+ headers["Cookie"] = cookie
508
+
509
+ return lazyrequests.lazy_requests(
510
+ method="GET",
511
+ params=params,
512
+ url=f"{scheme}://{host}{url_filename}",
513
+ headers=headers,
514
+ timeout=timeout
515
+ )
@@ -0,0 +1,31 @@
1
+ from lazysdk import lazyrequests
2
+
3
+
4
+ def campaigns(token: str):
5
+ """
6
+ 获取所有的campaign
7
+ """
8
+ url = "https://o.applovin.com/campaign_management/v1/campaigns"
9
+ return lazyrequests.lazy_requests(
10
+ method="GET",
11
+ url=url,
12
+ headers={"Authorization": token},
13
+ timeout=60
14
+ )
15
+
16
+
17
+ def campaign_targets(
18
+ token: str,
19
+ campaign_id: str
20
+ ):
21
+ """
22
+ 获取所有的campaign的目标信息
23
+ """
24
+ url = f"https://o.applovin.com/campaign_management/v1/campaign_targets/{campaign_id}"
25
+ return lazyrequests.lazy_requests(
26
+ method="GET",
27
+ url=url,
28
+ headers={"Authorization": token},
29
+ timeout=60
30
+ )
31
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazyad
3
- Version: 0.0.70
3
+ Version: 0.0.72
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.70",
16
+ version="0.0.72",
17
17
  description="基于Python的懒人包-适用于广告投放模块",
18
18
  long_description=long_description,
19
19
  long_description_content_type="text/markdown",
@@ -1,14 +0,0 @@
1
- from lazysdk import lazyrequests
2
-
3
-
4
- def campaigns(token: str):
5
- """
6
- 获取所有的campaign
7
- """
8
- url = "https://o.applovin.com/campaign_management/v1/campaigns"
9
- return lazyrequests.lazy_requests(
10
- method="GET",
11
- url=url,
12
- headers={"Authorization": token},
13
- timeout=60
14
- )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes