I accessed a specific document in Quip with the Quip API to parse the text stored in Sheets on Quip. Make a note of the access method at that time for personal use.
Get Token with POSTMAN. For more information, see Quip API Documentation (https://quip.com/dev/automation/documentation)
GET https://platform.quip.com/1/users/current
Get folders and documents using the function to get the spreadsheet on Github.
quip_analysis.py
import quip
# access to the quip
client = quip.QuipClient(access_token=<access_token>)
# Get your thread_id from the URL of your document
user = client.get_authenticated_user()
starred = client.get_folder(user["starred_folder_id"])
# get the spreadsheet
spreadsheet = client.get_second_spreadsheet(thread_id=<thread_id>)
parsedSpreadsheet = client.parse_spreadsheet_contents(spreadsheet)
Since you can get the data in spread format, drop it in the data frame
quip_analysis.py
# create the dataframe
counter = 0
spreadsheetData = []
colNames = []
for rows in parsedSpreadsheet["rows"]:
cells = rows["cells"]
rowData = []
for key, value in cells.items():
if counter == 0:
colNames.append(key)
rowData.append(value['content'])
spreadsheetData.append(rowData)
counter += 1
l = pd.DataFrame(spreadsheetData, columns=colNames)
After that, frequent words on the document were extracted by morphological analysis.
Recommended Posts