I have some data that I want to write to a simple multi-column table in Google Docs. Is this way too cumbersome to even begin attempting? I would just render it in XHTML, but my client has a very specific work flow set up on Google Docs that she doesn't want me to interfere with. The Google Docs API seems more geared toward updating metadata and making simple changes to the file format than it is toward undertaking the task of writing entire documents using only raw data and a few formatting rules. Am I missing something, or are there any other libraries that might be able to achieve this?
1 Answer
From the docs:
What can this API do?
The Google Documents List API allows developers to create, retrieve, update, and delete Google Docs (including but not limited to text documents, spreadsheets, presentations, and drawings), files, and collections.
So maybe you could save your data to an excel worksheet temporarily and then upload and convert this.
Saving to excel can be done with xlwt:
import xlwt
workbook = xlwt.Workbook()
sheet = workbook.add_sheet('Sheet 1')
sheet.write(0,1,'First text')
workbook.save('test.xls')
4 Comments
heltonbiker
There is a dedicated spreadsheet api here: developers.google.com/google-apps/spreadsheets
Thorsten Kranz
But this cannot be used for uploading or creating. They point developers to the documents-list API linked to in my answer
user1427661
I could do a spreadsheet in the worst case scenario, but the data is more conducive to a table in a word document, and not one easily convertible from a spreadsheet format either.
Thorsten Kranz
Then just make a compatible word-like document and upload it, e.g., look here