因此,我一直在尝试使用python创建一个新的空白google电子表格。我正在使用我在网上找到的python脚本(也添加了我自己的一些修改),我只是无法让它以我想要的方式工作。我从来没有真正使用过python,也没有谷歌的电子表格,所以我有点困惑!!当前的问题是,每当我运行代码时,它似乎都正常工作,但是当我复制/粘贴新生成的google电子表格的URL时,我甚至没有查看它的权限。这是我的code....Thank你提前!!
"""
BEFORE RUNNING:
---------------
1. If not already done, enable the Goo
"""
BEFORE RUNNING:
---------------
1. If not already done, enable the Google Sheets API
and check the quota for your project at
https://console.developers.google.com/apis/api/sheets
2. Install the Python client library for Google APIs by running
`pip install --upgrade googl
我正在运行Python Google Sheet API,并且得到这个错误AttributeError:'str‘对象没有'valid’属性?
我是Python Google Sheet API的新手;我没有得到足够的东西来尝试不同的方法来解决它。
from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
f
这个问题是关于在使用Python写入Google表时使用API密钥进行身份验证的问题。遵循示例,我将使用一个URL“发现”API:
service = discovery.build('sheets', 'v4', discoveryServiceUrl=
'https://sheets.googleapis.com/$discovery/rest?version=v4',
developerKey=APIKEY)
以这种方式传递API密钥似乎是可行的(它不会抛出异常)。之后,我尝试用batchUpdate更新电子表格。
ser
我在Google Cloud Functions上运行了一个HTTP触发的函数,它使用require('googleapis').sheets('v4')将数据写入文档电子表格。
对于本地开发,我通过他们的开发人员控制台的部分添加了一个帐户。我下载了令牌文件(下面是dev-key.json),并使用它对我对Sheets API的请求进行身份验证,如下所示:
var API_ACCT = require("./dev-key.json");
let apiClient = new google.auth.JWT(
API_ACCT.client
我遵循了指南(),并能够使用他们提供的代码使其工作:
def get_credentials():
"""Gets valid user credentials from storage.
If nothing has been stored, or if the stored credentials are invalid,
the OAuth2 flow is completed to obtain the new credentials.
Returns:
Credentials, the obtained cr
我运行了这段代码,但它给出了错误: redirect_uri_mismatch .I在client_secret.json文件中设置重定向uri。但每次重定向uri都类似于(每次更改端口号),但不是我在client_secret.json中给出的。
public class SheetsQuickstart {
private static final String APPLICATION_NAME = "Web client 1";
private static final java.io.File DATA_STORE_DIR = new java.io.Fil
我正在尝试通过我的网页授权Sheets API v4 (包括获取凭证)(假设我有一个名为"authorize google sheets“的按钮),所以当任何人点击该按钮时,他们将通过浏览器被带到他们的谷歌帐户授权(包括自动创建凭证),这样他们就不必手动转到console.developers.google.com/apis并创建凭证。 有没有办法做到这一点,或者有没有办法根本不使用凭证并授权给sheets api?
我试着运行这段使用谷歌云的代码。
import signal
import sys
from google.cloud import language, exceptions
# create a Google Cloud Natural Languague API Python client
client = language.LanguageServiceClient()
但它提供了以下错误消息:
Traceback (most recent call last):
File "analyse-comments.py", line 7, in <modul
我正在尝试通过脚本创建一个google sheets文档,并且我正在使用google在这里提供的执行API示例:
我所做的唯一更改是脚本中的一行:
function getFoldersUnderRoot() {
var sheet = SpreadsheetApp.create("MySheet"); //This line.
var root = DriveApp.getRootFolder();
var folders = root.getFolders();
var folderSet = {};
while (fold
我正在开发一个android应用程序,它可以与谷歌工作表接口。我遵循api文档将值写入特定的单元格,但是在这里我得到了这个错误:
Caused by: java.io.IOException: The Application Default Credentials are not available.
我确保在google平台上为我的项目设置我的凭证,并将.json文件下载到我的android项目中的src\main\resources中。
下面是编写数据的代码:
package com.example.frcscout22
import android.os.Bundle
import a
我试图从Python (在GKE中运行)访问Google (读-写模式)。我尝试过outh2client和google方法,但每次都会出现相同的错误:
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://sheets.googleapis.com/v4/spreadsheets/1kvHv1OBCzr9GnFxRu9RTJC7jjQjc9M4rAiDnhyak2Sg/values/vm_metrics%21A10?alt=json returned "Request had insuff
嗨,我刚刚开始学习PHP,我正在尝试使用Google sheets API。
我认为我遵循了他们的指示,我可以很好地调用和编辑工作表数据,但只能是公共访问。
当我将访问状态更改为private或Group时,遇到以下消息。
PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message '{
"error": {
"code": 403,
"message": "The caller does not ha
从node.js应用程序(不和谐的机器人)中,我尝试使用npm包访问公共googlesheet。
我仔细地遵循了每一步,但是我希望只使用API键身份验证方法,而不是使用风险更高的Oauth标识。
(我的不和谐机器人是公开的,我不想在heroku上乱搞太多敏感信息,即使我使用了环境变量)
关于google-spreadsheet.js的文档,它提到:
// OR use API key -- only for read-only access to public sheets
doc.useApiKey('YOUR-API-KEY');
我可以成功地将连接到、和,读取它的标题,和
在过去的10天里,通过使用python 3,通过使用google_auth_oauthlib和googleapiclient包,我能够创建Google (使用python代码),并对任何单元格执行基本的写/读值。我通过浏览Youtube上的随机视频来完成这个任务。
今天晚上,代码突然停止处理以下错误:
google.auth.exceptions.RefreshError: ('invalid_grant: Token has been expired or revoked.', {'error': 'invalid_grant', 'e
我以前运行过。当我今天试图让它运行时,我发现一个错误,它不支持Python3:-
ERROR: Python 3 and later is not compatible with the Google Cloud SDK.
Please use Python version 2.7.x.
If you have a compatible Python interpreter installed, you can use it by setting
the CLOUDSDK_PYTHON environment variable to point to it.
所以我输入了以下命令:-
ex
我有一个谷歌电子表格,这是共享的“任何人与链接可以编辑”。我想执行一个PUT请求来使用v4编辑这个文档。理想情况下,我希望只使用API密钥,而不使用OAuth2,因为使用OAuth与谷歌进行身份验证是一件很麻烦的事情。此外,这将要求用户每小时输入一个密码,这将破坏可用性。
据说,,不需要OAuth。这适用于GET请求,但当对PUT请求执行此操作时,我会得到401响应。(,这使我相信,只要目标文档是公开共享的,这也适用于PUT请求)。
GET https://sheets.googleapis.com/v4/spreadsheets/{sheetId}/values/Sheet1%21A1%3A