简体   繁体   English

从 Google 表格 API 和 python 获取过滤后的数据?

[英]Get filtered data from Google Sheets API with python?

didn't found an answer.没有找到答案。 Is it possible to use Python Google sheets API eg service.spreadsheets().get() to get data from spreadsheet only matching some criteria.是否可以使用 Python Google 表格 API 例如service.spreadsheets().get()从电子表格中获取仅符合某些条件的数据。 For example from this spreadsheet例如来自这个电子表格

I want to get names with timestamp older than 5/3/2020 12:00:00.我想获取时间戳早于 2020 年 5 月 3 日 12:00:00 的名称。 Is it possible to get, or I need to retrieve all data and filter with script?是否可以获取,或者我需要检索所有数据并使用脚本进行过滤?

Thanks, and sorry for screenshot outside of topic.谢谢,对于主题之外的截图感到抱歉。

Unfortunately it's not possible to retrieve a filtered range using the Sheets API in python.不幸的是,无法使用 python 中的表格 API 检索过滤范围。

Either you apply a filter to the entire range directly in your code or you can use Google Visualization API.您可以直接在代码中对整个范围应用过滤器,也可以使用 Google Visualization API。 Here you can find a guide on how to use the Google Visualization API with the Spreadsheet.在这里,您可以找到有关如何将 Google 可视化 API 与电子表格一起使用的指南。 Note that you will have to make your google sheet public in this case.请注意,在这种情况下,您必须公开您的 google 表格。

Reference参考

Google visualization API 谷歌可视化 API

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM