Programatically updating a spreadsheet hosted on google docs

前端 未结 6 1783
暖寄归人
暖寄归人 2021-02-01 10:56

I\'ve got a pre-existing spreadsheet hosted on google docs. Each month I update this document. I\'ve got a template workseet in the spreadseet that I\'d like to clone and then

6条回答
  •  梦如初夏
    2021-02-01 11:06

    This is really complicated. I understand that you can edit your spreadsheets with Python using their API, Google tends to offer that ability on many of their web services and it's all done by sending HTTP post requests made of XML somehow, I hope you know that part, I don't.

    According to this you can at least add worksheets, read rows from other worksheets and write rows to worksheets. if you must, you could copy it one row at a time, however sending an additional POST request for each row seems like a horrible idea.

    Edit:

    I'm learning more and more about this, but still a long way off from solving your original problem. This overview of REST principles goes over the basic style of interaction that goes on between programs on the web. Google seems to be following it religiously.

    It all takes place within the HTTP protocol, something I knew nothing about before today. In this HTTP specification the basic game is spelled out. Its not as dry as it looks, and maybe I'm just a huge geek, but I find it an inspiring read. Not unlike The Constitution of The United States.

    So since you want to "clone" a document, your going to be using a GET request for a particular worksheet, and then sending that worksheet back as the payload of POST.

    Getting closer :)

提交回复
热议问题