I need to make a tool with Python which needs to read data from a given Quip. I have read the Quip Api documentation but I can't find anything code related.
Does anyone have a source of inspiration for this implementation?
I tried 2 different implementation from various sources but they are not working:
1.
import quip
import quipclient as quipclient
id = 'completed with id'
thread = 'TestSpreadsheet'
base_url = 'completed with base_url'
ACCES_TOKEN = "completed with the token"
client = quip.QuipClient(access_token=ACCES_TOKEN, base_url = base_url)
with open("template.html", "rt") as f:
template = f.read()
jso = client.new_document(template, title="My Spreadsheet", type="spreadsheet")
thread_id = jso['thread']["id"] --> not sure where do I get that from
user = client.get_authenticated_user()
print(f'User: {user}')
client.update_spreadsheet_headers((thread_id, 'Name', 'Email'))
client.get_thread(id)
spreadsheet = client.get_first_spreadsheet(thread_id)
headers = client.get_spreadsheet_header_items(spreadsheet)
print(headers)
import quip
import pandas as pd
import numpy as np
import html5lib
token = 'completed with token'
base_url = 'completed with base url'
thread_id = not sure where do I get that from
client = quip.QuipClient(token, base_url = base_url)
rawdictionary = client.get_thread(thread_id)
dfs=pd.read_html(rawdictionary['html'])
raw_df = dfs[0]
In the latest version, Quip has put the thread ID in the url as well so for example:
https://<your enterprise quip host>/<thread_id>/<your spreadsheet name>
So for exporting a spreadsheet to lets say a dataframe following would be helper code