如何使用PythonSDK

问题描述 投票:0回答:1

https://developers.google.com/docs/api/how-tos/tabs
  • Https://developers.google.com/docs/api/reference/rest/rest/v1/documents/request
  • from googleapiclient.discovery import build from google.oauth2 import service_account credentials = service_account.Credentials.from_service_account_file( 'path_to_your_service_account.json', scopes=['https://www.googleapis.com/auth/documents'] ) service = build('docs', 'v1', credentials=credentials) DOCUMENT_ID = 'your_google_doc_id' requests = [ { 'updateParagraphStyle': { 'range': { 'startIndex': 1, 'endIndex': 10, }, 'paragraphStyle': { 'alignment': 'CENTER', }, 'fields': 'alignment', } }, ] service.documents().batchUpdate( documentId=DOCUMENT_ID, body={'requests': req
python google-workspace google-docs-api
1个回答
0
投票
© www.soinside.com 2019 - 2025. All rights reserved.