Wrike Information (Folder, Task, Details) in Python

Here is sample python: would be happy to help.

def WrikeResponse (url, querystring):
wrikeurl = 'https://www.wrike.com/api/v4/' + url
payload = ""
headers = {
'Authorization': "Bearer eyJ0dCI6InAiLCJhbGciOiJIUzI1NiIsInR2IjoiMSJ9.eyJkIjoie1wiYVwiOjc4NjMyNSxcImlcIjo2MTQzMTM4LFwiY1wiOjQ1OTMzMjQsXCJ1XCI6MzI1OTkzOSxcInJcIjpcIlVTXCIsXCJzXCI6W1wiV1wiLFwiRlwiLFwiSVwiLFwiVVwiLFwiS1wiLFwiQ1wiLFwiQVwiLFwiTFwiXSxcInpcIjpbXSxcInRcIjowfSIsImlhdCI6MTU1NjMwMjQyMn0.EoAcG1jk2Mr4ecBwl3fPCfucbHbLme4oT7pyZofT8eI",
'cache-control': "no-cache",
jsondata = ''
with requests.request("GET", wrikeurl, data=payload, headers=headers, params=querystring) as response:
if response.status_code == 200:
jsondata = response.json()
jsondata = response.status_code
print('Error while fetching data!')
return jsondata

def GetFolders():
url = 'folders'
records = []
querystring = ""
jsondata = WrikeResponse(url, querystring)
for row in jsondata['data']:
item = row['id'], row['title']
return records

def GetProjectsFromFolder(FolderId):
url = 'folders/' + FolderId + '/tasks'
records = []
querystring = {
'fields': '["subTaskIds","customFields"]',
'descendants': 'true',
'subTasks': 'true',
jsondata = WrikeResponse(url, querystring)
for row in jsondata['data']:
item = {'id': row['id'], 'title': row['title'], 'status': row['status'],
'customStatusId': row['customStatusId'], 'dates': row['dates'], 'subTaskIds': row['subTaskIds'],
'customFields': row['customFields']}
return records

import Wrike
import tkinter as tk
from pandastable import Table
import pandas as pd

allFolders = Wrike.GetFolders()
folderId = [f for f in allFolders if f[1] == "folder name"]
allProjects = Wrike.GetProjectsFromFolder(folderId[0][0])
filteredProjects = [x for x in allProjects if x['status'] == 'Active']
df = pd.DataFrame(allProjects)
df.to_excel(r'C:\Users\PACE\Desktop\export_dataframe.xlsx', index=False, header=True)

root = tk.Tk()
root.title('PandasTable Example')

frame = tk.Frame(root)
frame.pack(fill='both', expand=True)

pt = Table(frame, dataframe=df, showtoolbar=True, showstatusbar=True)

pt.columncolors['A'] = 'red'
pt.columncolors['B'] = 'green'

0 comentarios

Can you help? Answer the question and work your way towards becoming a Wrike Ninja 🥋 Sign in and answer.

Iniciar sesión para dejar un comentario.

Folllowing List for Post: Wrike Information (Folder, Task, Details) in Python
[this list is visible for admins and agents only]

Didn’t find what you were looking for? Write new post