lazyad 0.0.13__tar.gz → 0.0.14__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.13
3
+ Version: 0.0.14
4
4
  Summary: 基于Python的懒人包-适用于广告投放模块
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazyad
6
6
  Author: ZeroSeeker
@@ -1,3 +1,4 @@
1
+ import showlog
1
2
  from lazysdk import lazyrequests
2
3
  import random
3
4
  import time
@@ -115,8 +116,10 @@ def oauth_token3(
115
116
  def get_organization_account_relation(
116
117
  access_token: str,
117
118
  account_id=None,
119
+ cursor=None,
118
120
  page: int = 1,
119
- page_size: int = 100
121
+ page_size: int = 100,
122
+ pagination_mode: str = "PAGINATION_MODE_CURSOR"
120
123
  ):
121
124
  """
122
125
  版本:3.0
@@ -125,8 +128,10 @@ def get_organization_account_relation(
125
128
  https://developers.e.qq.com/v3.0/docs/api/organization_account_relation/get
126
129
  :param access_token:
127
130
  :param account_id:
131
+ :param cursor:
128
132
  :param page:
129
133
  :param page_size: 最小值 1,最大值 100
134
+ :param pagination_mode: 分页方式,注意,为PAGINATION_MODE_NORMAL时,不能获取大于1000条的记录
130
135
  :return:
131
136
  """
132
137
  url = 'https://api.e.qq.com/v3.0/organization_account_relation/get'
@@ -134,10 +139,17 @@ def get_organization_account_relation(
134
139
  'access_token': access_token,
135
140
  'timestamp': int(time.time()),
136
141
  'nonce': make_nonce(),
137
- "page": page,
138
- "page_size": page_size,
139
- "pagination_mode": "PAGINATION_MODE_NORMAL"
142
+ "pagination_mode": pagination_mode,
143
+ "page_size": page_size
140
144
  }
145
+ if pagination_mode == "PAGINATION_MODE_NORMAL":
146
+ params["page"] = page
147
+ elif pagination_mode == "PAGINATION_MODE_CURSOR":
148
+ params["cursor"] = cursor
149
+ else:
150
+ showlog.warning("pagination_mode参数错误")
151
+ return
152
+
141
153
  if account_id:
142
154
  params["account_id"] = account_id
143
155
  return lazyrequests.lazy_requests(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazyad
3
- Version: 0.0.13
3
+ Version: 0.0.14
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.13",
16
+ version="0.0.14",
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