logos-sdk 0.0.25.dev5__tar.gz → 0.0.25.dev7__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.
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/PKG-INFO +1 -1
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/MerchantCenter.py +31 -17
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/MicrosoftAdvertising.py +47 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk.egg-info/PKG-INFO +1 -1
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/LICENSE +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/README.md +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/__init__.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/big_query/BigQuery.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/big_query/__init__.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/logging/LogosLogger.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/logging/__init__.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/CampaignManager.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/Collabim.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/DV360.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/Facebook.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/GoogleAds.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/GoogleSheets.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/MarketMiner.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/Sklik.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk/services/__init__.py +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk.egg-info/SOURCES.txt +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk.egg-info/dependency_links.txt +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk.egg-info/requires.txt +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/logos_sdk.egg-info/top_level.txt +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/setup.cfg +0 -0
- {logos_sdk-0.0.25.dev5 → logos_sdk-0.0.25.dev7}/setup.py +0 -0
|
@@ -37,7 +37,7 @@ class MerchantCenterService:
|
|
|
37
37
|
raise MerchantServiceException(response.content)
|
|
38
38
|
|
|
39
39
|
def list_account_statuses(
|
|
40
|
-
|
|
40
|
+
self, merchant_account_id: str, account_id: str, secret_id: str
|
|
41
41
|
):
|
|
42
42
|
"""
|
|
43
43
|
Retrieves the statuses of a Merchant Center account.
|
|
@@ -62,21 +62,35 @@ class MerchantCenterService:
|
|
|
62
62
|
else:
|
|
63
63
|
raise MerchantServiceException(response.content)
|
|
64
64
|
|
|
65
|
-
def list_products(self, merchant_account_id: str, secret_id: str):
|
|
65
|
+
def list_products(self, merchant_account_id: str, secret_id: str, page_size: int = 250):
|
|
66
66
|
"""
|
|
67
67
|
Lists the products in your Merchant Center account
|
|
68
68
|
:param merchant_account_id: The ID of the managing account. This account cannot be a multi-client account
|
|
69
69
|
:param secret_id: The ID of the secret in secret manager
|
|
70
|
+
:param page_size: size of the page
|
|
70
71
|
:return: List[Dict]
|
|
71
72
|
"""
|
|
72
|
-
body = {"merchant_account_id": merchant_account_id, "secret_id": secret_id}
|
|
73
|
+
body = {"merchant_account_id": merchant_account_id, "secret_id": secret_id, "page_size": page_size}
|
|
73
74
|
header = get_headers(self._LIST_PRODUCTS)
|
|
74
75
|
response = request("post", url=self._LIST_PRODUCTS, json=body, headers=header)
|
|
76
|
+
|
|
77
|
+
if response.status_code != HTTPStatus.OK:
|
|
78
|
+
raise MerchantServiceException(response.content)
|
|
79
|
+
|
|
75
80
|
service_response = response.json()
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
yield service_response["data"]["results"]
|
|
82
|
+
|
|
83
|
+
while service_response["data"]["nextPageToken"] is not None:
|
|
84
|
+
body["page_token"] = service_response["data"]["nextPageToken"]
|
|
85
|
+
response = request(
|
|
86
|
+
"post", url=self._LIST_PRODUCTS, json=body, headers=header
|
|
87
|
+
)
|
|
78
88
|
|
|
79
|
-
|
|
89
|
+
if response.status_code != HTTPStatus.OK:
|
|
90
|
+
raise MerchantServiceException(response.content)
|
|
91
|
+
|
|
92
|
+
service_response = response.json()
|
|
93
|
+
yield service_response["data"]["results"]
|
|
80
94
|
|
|
81
95
|
def list_products_statuses(self, merchant_account_id: str, secret_id: str):
|
|
82
96
|
"""
|
|
@@ -99,12 +113,12 @@ class MerchantCenterService:
|
|
|
99
113
|
raise MerchantServiceException(response.content)
|
|
100
114
|
|
|
101
115
|
def reports_search(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
116
|
+
self,
|
|
117
|
+
merchant_account_id: str,
|
|
118
|
+
secret_id: str,
|
|
119
|
+
query: str,
|
|
120
|
+
page_token: str = None,
|
|
121
|
+
page_size: int = 1000,
|
|
108
122
|
):
|
|
109
123
|
body = {
|
|
110
124
|
"merchant_account_id": merchant_account_id,
|
|
@@ -123,11 +137,11 @@ class MerchantCenterService:
|
|
|
123
137
|
raise MerchantServiceException(response.content)
|
|
124
138
|
|
|
125
139
|
def reports_search_generator(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
140
|
+
self,
|
|
141
|
+
merchant_account_id: str,
|
|
142
|
+
secret_id: str,
|
|
143
|
+
query: str,
|
|
144
|
+
page_size: int = 1000,
|
|
131
145
|
):
|
|
132
146
|
body = {
|
|
133
147
|
"merchant_account_id": merchant_account_id,
|
|
@@ -25,6 +25,7 @@ class MicrosoftAdvertising:
|
|
|
25
25
|
self._GET_ACCESSIBLE_ACCOUNTS = self._URL + "/accessible-accounts"
|
|
26
26
|
self._GET_DESTINATION_URL_REPORT = self._URL + "/destination-url-report"
|
|
27
27
|
self._GET_CAMPAIGN_PERFORMANCE_REPORT = self._URL + "/campaign-performance-report"
|
|
28
|
+
self._GET_GEOGRAPHIC_PERFORMANCE_REPORT = self._URL + "/geographic-performance-report"
|
|
28
29
|
self._GET_BUDGET_SUMMARY_REPORT = self._URL + "/budget-summary-report"
|
|
29
30
|
|
|
30
31
|
def get_destination_url_report(
|
|
@@ -74,6 +75,52 @@ class MicrosoftAdvertising:
|
|
|
74
75
|
else:
|
|
75
76
|
raise MicrosoftAdvertisingException(response.content)
|
|
76
77
|
|
|
78
|
+
def get_geographic_report(
|
|
79
|
+
self,
|
|
80
|
+
account_id: str,
|
|
81
|
+
secret_id: str,
|
|
82
|
+
date_from: str,
|
|
83
|
+
date_to: str,
|
|
84
|
+
report_columns: List[str],
|
|
85
|
+
entity_statuses: dict = None,
|
|
86
|
+
) -> List:
|
|
87
|
+
"""
|
|
88
|
+
Calls endpoint for getting geographic stats
|
|
89
|
+
https://learn.microsoft.com/en-us/advertising/reporting-service/geographicperformancereportrequest?view=bingads-13&tabs=xml
|
|
90
|
+
:param account_id: The ID of the account in Microsoft Advertising
|
|
91
|
+
:param secret_id: The ID of the secret in secret manager
|
|
92
|
+
:param date_from: The date we want the report to start from. Must be before date to
|
|
93
|
+
:param date_to: The date we want the report to end at
|
|
94
|
+
:param report_columns: stats we want included in the report
|
|
95
|
+
:param entity_statuses: dict containing status ad_group_status, campaign_status and account_status
|
|
96
|
+
:return: List of campaigns and their geographic stats
|
|
97
|
+
"""
|
|
98
|
+
if entity_statuses is None:
|
|
99
|
+
entity_statuses = {
|
|
100
|
+
"ad_group_status": EntityStatus.ACTIVE,
|
|
101
|
+
"campaign_status": EntityStatus.ACTIVE,
|
|
102
|
+
"account_status": EntityStatus.ACTIVE,
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
body = {
|
|
106
|
+
"account_id": account_id,
|
|
107
|
+
"secret_id": secret_id,
|
|
108
|
+
"date_from": date_from,
|
|
109
|
+
"date_to": date_to,
|
|
110
|
+
"report_columns": report_columns,
|
|
111
|
+
} | entity_statuses
|
|
112
|
+
|
|
113
|
+
header = get_headers(self._GET_GEOGRAPHIC_PERFORMANCE_REPORT)
|
|
114
|
+
response = request(
|
|
115
|
+
"post", url=self._GET_GEOGRAPHIC_PERFORMANCE_REPORT, json=body, headers=header
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
if response.status_code == HTTPStatus.OK:
|
|
119
|
+
service_response = response.json()
|
|
120
|
+
return service_response["data"]
|
|
121
|
+
else:
|
|
122
|
+
raise MicrosoftAdvertisingException(response.content)
|
|
123
|
+
|
|
77
124
|
def get_campaign_performance_report(
|
|
78
125
|
self,
|
|
79
126
|
account_id: str,
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|