如何以编程方式创建带有内容的Google文档电子表格? [英] How to programmatically create a Google Docs spreadsheet WITH CONTENT?

本文介绍了如何以编程方式创建带有内容的Google文档电子表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了多个有关如何使用创建或编辑Google Doc电子表格的StackOverflow问题Google Spreadsheets API 或更旧的API。然而,这个Spreadsheets API似乎是gdata库的一部分,我的理解是不推荐使用。



更新的StackOverflow答案显示了如何使用Drive API创建一个空的电子表格,似乎更加流行。但是,通过查看该API的文档和示例,它似乎只允许您使用电子表格MIME类型创建新的EMPTY文件。我还没有找到用于创建具有实际内容(例如,行,列,工作表等)的电子表格的功能。



创建新Google Doc的过程如何电子表格和填充内容? Drive API是否具有我不理解的功能?毕竟,gdata库(或至少它的Spreadsheets API部分)是否完全不推荐使用?有没有第三种方法我完全错过了?我正在使用Java代码,尽管我确信任何Python API都具有与Java相当的功能。

解决方案

答案为bullet form ...


  • 这只是旧的docslist API已弃用。由于没有替换,电子表格API仍然存在并且踢<

  • 可能不再支持gdata库,但直接使用电子表格API可能会更好。

  • Drive API仅涉及整个文件级别的操作

  • 您可以使用Drive API创建填充的电子表格,方法是上传文件的格式为转换为Google Spreadsheet,例如。 MS Excel

  • 请注意,电子表格API(可能还包括Drive API)尚不支持新的(2013年底)电子表格格式


I have found multiple StackOverflow questions dealing with how to create or edit Google Doc spreadsheets using the Google Spreadsheets API, or older API's. However, this Spreadsheets API seems to be part of the "gdata" library, which to my understanding is deprecated.

Newer StackOverflow answers show how to create an empty spreadsheet using the Drive API, which seems more current. However, from looking at the documentation and examples for that API, it seems to only let you create new EMPTY files with the spreadsheet MIME type. I have not found any functionality for creating a spreadsheet with actual content (i.e. rows, columns, worksheets, etc).

What is the current process for creating a new Google Doc spreadsheet AND populating it with content? Does the Drive API have functionality that I'm not understanding? Is the "gdata" library (or at least its Spreadsheets API portion) not completely deprecated after all? Is there some third approach that I've missed altogether? I'm working with Java code, to the extent that matters, although I'm sure that any Python API would have a Java equivalent.

解决方案

Answer in bullet form ...

  • It's only the old docslist API which is deprecated. The spreadsheet API is still alive and kicking since there is no replacement
  • The gdata libs are possibly no longer supported, but you will probably be better served using the spreadsheet API directly anyway
  • The Drive API is only concerned with operations at the whole file level
  • You could create a populated spreadsheet using the Drive API by uploading a file in a format that can be converted to a Google Spreadsheet, eg. MS Excel
  • Be aware that the spreadsheet API (and possibly the Drive API) do not yet support the new (end 2013) spreadsheet format

这篇关于如何以编程方式创建带有内容的Google文档电子表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆