6

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

1 Answer 1

3

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')
Sign up to request clarification or add additional context in comments.

4 Comments

There is a dedicated spreadsheet api here: developers.google.com/google-apps/spreadsheets
But this cannot be used for uploading or creating. They point developers to the documents-list API linked to in my answer
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.
Then just make a compatible word-like document and upload it, e.g., look here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.