lazyad 0.0.48__tar.gz → 0.0.49__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.
- {lazyad-0.0.48 → lazyad-0.0.49}/PKG-INFO +1 -1
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad/open/unity.py +125 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad.egg-info/PKG-INFO +1 -1
- {lazyad-0.0.48 → lazyad-0.0.49}/setup.py +1 -1
- {lazyad-0.0.48 → lazyad-0.0.49}/README.md +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad/__init__.py +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad/crawlers/__init__.py +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad/crawlers/chuangliang.py +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad/crawlers/mintegral.py +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad/crawlers/oceanengine.py +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad/crawlers/qq.py +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad/open/__init__.py +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad/open/mintegral.py +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad/open/qq.py +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad.egg-info/SOURCES.txt +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad.egg-info/dependency_links.txt +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad.egg-info/requires.txt +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/lazyad.egg-info/top_level.txt +0 -0
- {lazyad-0.0.48 → lazyad-0.0.49}/setup.cfg +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from lazysdk import lazyrequests
|
|
2
2
|
from lazysdk import lazybase64
|
|
3
|
+
from lazysdk import lazytime
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
def make_auth(
|
|
@@ -194,3 +195,127 @@ def update_targeting_options(
|
|
|
194
195
|
headers=headers,
|
|
195
196
|
json=data
|
|
196
197
|
)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def reports(
|
|
201
|
+
organization_id,
|
|
202
|
+
keyid,
|
|
203
|
+
secret_key,
|
|
204
|
+
start: str,
|
|
205
|
+
end: str,
|
|
206
|
+
scale: str = "day",
|
|
207
|
+
metrics: list = None,
|
|
208
|
+
breakdowns: list = None
|
|
209
|
+
):
|
|
210
|
+
"""
|
|
211
|
+
https://services.docs.unity.com/statistics/index.html#tag/Acquisitions/operation/stats_acquisition
|
|
212
|
+
:param metrics:
|
|
213
|
+
starts
|
|
214
|
+
views
|
|
215
|
+
clicks
|
|
216
|
+
installs
|
|
217
|
+
spend
|
|
218
|
+
cpi
|
|
219
|
+
ctr
|
|
220
|
+
cvr
|
|
221
|
+
ecpm
|
|
222
|
+
d0AdRevenue
|
|
223
|
+
d1AdRevenue
|
|
224
|
+
d3AdRevenue
|
|
225
|
+
d7AdRevenue
|
|
226
|
+
d14AdRevenue
|
|
227
|
+
d0AdRevenueRoas
|
|
228
|
+
d1AdRevenueRoas
|
|
229
|
+
d3AdRevenueRoas
|
|
230
|
+
d7AdRevenueRoas
|
|
231
|
+
d14AdRevenueRoas
|
|
232
|
+
d0IapRevenue
|
|
233
|
+
d1IapRevenue
|
|
234
|
+
d3IapRevenue
|
|
235
|
+
d7IapRevenue
|
|
236
|
+
d14IapRevenue
|
|
237
|
+
d0IapRoas
|
|
238
|
+
d1IapRoas
|
|
239
|
+
d3IapRoas
|
|
240
|
+
d7IapRoas
|
|
241
|
+
d14IapRoas
|
|
242
|
+
d0Purchases
|
|
243
|
+
d1Purchases
|
|
244
|
+
d3Purchases
|
|
245
|
+
d7Purchases
|
|
246
|
+
d14Purchases
|
|
247
|
+
d0UniquePurchasers
|
|
248
|
+
d1UniquePurchasers
|
|
249
|
+
d3UniquePurchasers
|
|
250
|
+
d7UniquePurchasers
|
|
251
|
+
d14UniquePurchasers
|
|
252
|
+
d0Retained
|
|
253
|
+
d1Retained
|
|
254
|
+
d3Retained
|
|
255
|
+
d7Retained
|
|
256
|
+
d14Retained
|
|
257
|
+
d0RetentionRate
|
|
258
|
+
d1RetentionRate
|
|
259
|
+
d3RetentionRate
|
|
260
|
+
d7RetentionRate
|
|
261
|
+
d14RetentionRate
|
|
262
|
+
d0TotalRoas
|
|
263
|
+
d1TotalRoas
|
|
264
|
+
d3TotalRoas
|
|
265
|
+
d7TotalRoas
|
|
266
|
+
d14TotalRoas
|
|
267
|
+
d0LevelComplete
|
|
268
|
+
d1LevelComplete
|
|
269
|
+
d3LevelComplete
|
|
270
|
+
d7LevelComplete
|
|
271
|
+
d14LevelComplete
|
|
272
|
+
d0CostPerLevelComplete
|
|
273
|
+
d1CostPerLevelComplete
|
|
274
|
+
d3CostPerLevelComplete
|
|
275
|
+
d7CostPerLevelComplete
|
|
276
|
+
d14CostPerLevelComplete
|
|
277
|
+
d0LevelCompleteRate
|
|
278
|
+
d1LevelCompleteRate
|
|
279
|
+
d3LevelCompleteRate
|
|
280
|
+
d7LevelCompleteRate
|
|
281
|
+
d14LevelCompleteRate
|
|
282
|
+
:param breakdowns:
|
|
283
|
+
app,campaign,country,creativePack,
|
|
284
|
+
creativePackType,osVersion,platform,sourceAppId,store,targetGame,eventType,eventName
|
|
285
|
+
:return:
|
|
286
|
+
"""
|
|
287
|
+
authorization = f"Basic {keyid}:{secret_key}"
|
|
288
|
+
url = f"https://services.api.unity.com/advertise/stats/v2/organizations/{organization_id}/reports/acquisitions"
|
|
289
|
+
params = {
|
|
290
|
+
"scale": scale, # "summary" "hour" "day" "week" "month"
|
|
291
|
+
"format": "json"
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if not metrics:
|
|
295
|
+
metrics = [
|
|
296
|
+
"spend"
|
|
297
|
+
]
|
|
298
|
+
if not breakdowns:
|
|
299
|
+
breakdowns = [
|
|
300
|
+
"country"
|
|
301
|
+
]
|
|
302
|
+
|
|
303
|
+
params["breakdowns"] = ",".join(breakdowns)
|
|
304
|
+
params["metrics"] = ",".join(metrics)
|
|
305
|
+
params["start"] = start
|
|
306
|
+
params["end"] = end
|
|
307
|
+
|
|
308
|
+
headers = {"Authorization": authorization}
|
|
309
|
+
response = lazyrequests.lazy_requests(
|
|
310
|
+
method="GET",
|
|
311
|
+
url=url,
|
|
312
|
+
params=params,
|
|
313
|
+
headers=headers
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
status = response.get("status")
|
|
317
|
+
if status is None:
|
|
318
|
+
data = response.get("data")
|
|
319
|
+
return data
|
|
320
|
+
else:
|
|
321
|
+
return response
|
|
@@ -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.
|
|
16
|
+
version="0.0.49",
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|