brynq-sdk-monday 1.2.2__tar.gz → 1.2.4__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.
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/PKG-INFO +1 -1
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday/extract_monday.py +12 -7
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday/extract_tracket.py +4 -3
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday/upload_tracket.py +5 -4
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday.egg-info/PKG-INFO +1 -1
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/setup.py +1 -1
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday/__init__.py +0 -0
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday.egg-info/SOURCES.txt +0 -0
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday.egg-info/dependency_links.txt +0 -0
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday.egg-info/not-zip-safe +0 -0
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday.egg-info/requires.txt +0 -0
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday.egg-info/top_level.txt +0 -0
- {brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/setup.cfg +0 -0
|
@@ -20,6 +20,7 @@ class ExtractMonday(BrynQ):
|
|
|
20
20
|
self.headers = self.__get_headers(label=label)
|
|
21
21
|
self.endpoint = "https://api.monday.com/v2/"
|
|
22
22
|
self.debug = debug
|
|
23
|
+
self.timeout = 3600
|
|
23
24
|
|
|
24
25
|
def __get_headers(self, label):
|
|
25
26
|
credentials = self.get_system_credential(system='monday', label=label)
|
|
@@ -51,7 +52,7 @@ class ExtractMonday(BrynQ):
|
|
|
51
52
|
})
|
|
52
53
|
if self.debug:
|
|
53
54
|
print(payload)
|
|
54
|
-
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload)
|
|
55
|
+
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload, timeout=self.timeout)
|
|
55
56
|
if self.debug:
|
|
56
57
|
print(response.json())
|
|
57
58
|
response.raise_for_status()
|
|
@@ -153,7 +154,7 @@ class ExtractMonday(BrynQ):
|
|
|
153
154
|
})
|
|
154
155
|
if self.debug:
|
|
155
156
|
print(payload)
|
|
156
|
-
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload)
|
|
157
|
+
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload, timeout=self.timeout)
|
|
157
158
|
if self.debug:
|
|
158
159
|
print(response.json())
|
|
159
160
|
response.raise_for_status()
|
|
@@ -176,7 +177,7 @@ class ExtractMonday(BrynQ):
|
|
|
176
177
|
})
|
|
177
178
|
if self.debug:
|
|
178
179
|
print(payload)
|
|
179
|
-
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload)
|
|
180
|
+
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload, timeout=self.timeout)
|
|
180
181
|
if self.debug:
|
|
181
182
|
print(response.json())
|
|
182
183
|
response.raise_for_status()
|
|
@@ -199,7 +200,7 @@ class ExtractMonday(BrynQ):
|
|
|
199
200
|
})
|
|
200
201
|
if self.debug:
|
|
201
202
|
print(payload)
|
|
202
|
-
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload)
|
|
203
|
+
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload, timeout=self.timeout)
|
|
203
204
|
if self.debug:
|
|
204
205
|
print(response.json())
|
|
205
206
|
response.raise_for_status()
|
|
@@ -215,17 +216,21 @@ class ExtractMonday(BrynQ):
|
|
|
215
216
|
:param item_ids: all the items where you want to get the column values from
|
|
216
217
|
"""
|
|
217
218
|
# Chunk in lists of 50 items since monday.com doesn't accept requests longer than 50 items
|
|
219
|
+
if not isinstance(item_ids, list):
|
|
220
|
+
item_ids = item_ids.tolist()
|
|
221
|
+
else:
|
|
222
|
+
item_ids = item_ids
|
|
218
223
|
items_list = [item_ids[pos:pos + 25] for pos in range(0, len(item_ids), 25)]
|
|
219
224
|
all_data = []
|
|
220
225
|
|
|
221
226
|
for chunk in items_list:
|
|
222
227
|
payload = {
|
|
223
|
-
"query": f"query {{items (ids: {json.dumps(chunk
|
|
228
|
+
"query": f"query {{items (ids: {json.dumps(chunk)} exclude_nonactive: false) {{id name state updated_at column_values {{ column {{ title }} id text value }} }} }}"
|
|
224
229
|
}
|
|
225
230
|
payload = json.dumps(payload, ensure_ascii=False)
|
|
226
231
|
if self.debug:
|
|
227
232
|
print(payload)
|
|
228
|
-
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload)
|
|
233
|
+
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload, timeout=self.timeout)
|
|
229
234
|
if self.debug:
|
|
230
235
|
print(response.json())
|
|
231
236
|
response.raise_for_status()
|
|
@@ -301,7 +306,7 @@ class ExtractMonday(BrynQ):
|
|
|
301
306
|
print(payload)
|
|
302
307
|
continue_loop = True
|
|
303
308
|
while continue_loop:
|
|
304
|
-
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload)
|
|
309
|
+
response = requests.request("POST", self.endpoint, headers=self.headers, data=payload, timeout=self.timeout)
|
|
305
310
|
if self.debug:
|
|
306
311
|
print(response.json())
|
|
307
312
|
response.raise_for_status()
|
|
@@ -19,6 +19,7 @@ class ExtractTracket(BrynQ):
|
|
|
19
19
|
super().__init__()
|
|
20
20
|
self.headers = self.__get_headers(label=label)
|
|
21
21
|
self.base_url = "https://us.production.timesheet.avisi-apps.com/api/2.0/"
|
|
22
|
+
self.timeout = 3600
|
|
22
23
|
|
|
23
24
|
def __get_headers(self, label):
|
|
24
25
|
"""
|
|
@@ -37,7 +38,7 @@ class ExtractTracket(BrynQ):
|
|
|
37
38
|
"client-secret": credentials['client_secret']
|
|
38
39
|
})
|
|
39
40
|
headers = {'Content-Type': 'application/json'}
|
|
40
|
-
tracket_response = requests.request("POST", endpoint, headers=headers, data=payload)
|
|
41
|
+
tracket_response = requests.request("POST", endpoint, headers=headers, data=payload, timeout=self.timeout)
|
|
41
42
|
tracket_response.raise_for_status()
|
|
42
43
|
|
|
43
44
|
# Return the headers with the access_token
|
|
@@ -76,7 +77,7 @@ class ExtractTracket(BrynQ):
|
|
|
76
77
|
df = pd.DataFrame()
|
|
77
78
|
full_url = endpoint
|
|
78
79
|
while continue_loop:
|
|
79
|
-
response = requests.get(full_url, headers=self.headers)
|
|
80
|
+
response = requests.get(full_url, headers=self.headers, timeout=self.timeout)
|
|
80
81
|
response.raise_for_status()
|
|
81
82
|
response_data = response.json()
|
|
82
83
|
worklogs = response_data.get('items')
|
|
@@ -96,7 +97,7 @@ class ExtractTracket(BrynQ):
|
|
|
96
97
|
Get all the hour categories from Tracket.
|
|
97
98
|
"""
|
|
98
99
|
endpoint = f'{self.base_url}categories'
|
|
99
|
-
response = requests.request("GET", endpoint, headers=self.headers)
|
|
100
|
+
response = requests.request("GET", endpoint, headers=self.headers, timeout=self.timeout)
|
|
100
101
|
response.raise_for_status()
|
|
101
102
|
data = response.json()['categories']
|
|
102
103
|
df = pd.DataFrame(data)
|
|
@@ -21,6 +21,7 @@ class UploadTracket(BrynQ):
|
|
|
21
21
|
self.headers = self.__get_headers(label=label)
|
|
22
22
|
self.base_url = "https://us.production.timesheet.avisi-apps.com/api/2.0/"
|
|
23
23
|
self.debug = debug
|
|
24
|
+
self.timeout = 3600
|
|
24
25
|
|
|
25
26
|
def __get_headers(self, label):
|
|
26
27
|
"""
|
|
@@ -39,7 +40,7 @@ class UploadTracket(BrynQ):
|
|
|
39
40
|
"client-secret": credentials['client_secret']
|
|
40
41
|
})
|
|
41
42
|
headers = {'Content-Type': 'application/json'}
|
|
42
|
-
tracket_response = requests.request("POST", endpoint, headers=headers, data=payload)
|
|
43
|
+
tracket_response = requests.request("POST", endpoint, headers=headers, data=payload, timeout=self.timeout)
|
|
43
44
|
|
|
44
45
|
# Return the headers with the access_token
|
|
45
46
|
access_token = tracket_response.json()['access_token']
|
|
@@ -92,7 +93,7 @@ class UploadTracket(BrynQ):
|
|
|
92
93
|
if self.debug:
|
|
93
94
|
print(json.dumps(base_body))
|
|
94
95
|
|
|
95
|
-
response = requests.request("POST", url, data=json.dumps(base_body), headers=self.headers)
|
|
96
|
+
response = requests.request("POST", url, data=json.dumps(base_body), headers=self.headers, timeout=self.timeout)
|
|
96
97
|
return response
|
|
97
98
|
|
|
98
99
|
def update_worklog(self, worklog_id: str, data: dict) -> requests.Response:
|
|
@@ -125,7 +126,7 @@ class UploadTracket(BrynQ):
|
|
|
125
126
|
if self.debug:
|
|
126
127
|
print(json.dumps(base_body))
|
|
127
128
|
|
|
128
|
-
response = requests.request("PUT", url, data=json.dumps(base_body), headers=self.headers)
|
|
129
|
+
response = requests.request("PUT", url, data=json.dumps(base_body), headers=self.headers, timeout=self.timeout)
|
|
129
130
|
return response
|
|
130
131
|
|
|
131
132
|
def delete_worklog(self, worklog_id: str) -> requests.Response:
|
|
@@ -134,5 +135,5 @@ class UploadTracket(BrynQ):
|
|
|
134
135
|
:param worklog_id: The ID of the worklog that you want to delete.
|
|
135
136
|
"""
|
|
136
137
|
url = (f'{self.base_url}timeEntries/{worklog_id}')
|
|
137
|
-
response = requests.request("DELETE", url, headers=self.headers)
|
|
138
|
+
response = requests.request("DELETE", url, headers=self.headers, timeout=self.timeout)
|
|
138
139
|
return response
|
|
File without changes
|
|
File without changes
|
{brynq_sdk_monday-1.2.2 → brynq_sdk_monday-1.2.4}/brynq_sdk_monday.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|