Table

Libraries of gdoctableapp for golang, Node.js and python were updated to v110

Libraries of gdoctableapp for golang, Node.js and python were updated to v1.1.0

Libraries of gdoctableapp for golang, Node.js and python were updated to v105

Libraries of gdoctableapp for golang, Node.js and python were updated to v1.0.5

Update History

  • v1.0.5 (January 21, 2020)

    • When the inline objects and tables are put in the table. An error occurred. This bug was removed by this update.
  • I got the pull request at here.

Creating a Table to Google Document by Retrieving Values from Google Spreadsheet for Python

Gists

This is a sample script for creating a table to Google Document by retrieving values from Google Spreadsheet for Python.

Before you use this script, please install python library of gdoctableapppy.

$ pip install gdoctableapppy

Sample script:

This sample script uses Service Account.

In this sample script, the values are retrieved from Sheet1!A1:C5 of Spreadsheet, and new table is created to the Document using the values.

from google.oauth2 import service_account
from gdoctableapppy import gdoctableapp
from googleapiclient.discovery import build

SCOPES = ['https://www.googleapis.com/auth/documents',
          'https://www.googleapis.com/auth/spreadsheets']
SERVICE_ACCOUNT_FILE = 'credential.json' # Please set the json file of Service account.
creds = service_account.Credentials.from_service_account_file(
    SERVICE_ACCOUNT_FILE, scopes=SCOPES)

service = build('sheets', 'v4', credentials=creds)

spreadsheet_id = '###'  # Please set here
document_id = '###'  # Please set here

res = service.spreadsheets().values().get(
    spreadsheetId=spreadsheet_id, range='Sheet1!A1:C5').execute()
values = res['values']

resource = {
    "service_account": creds,
    "documentId": document_id,
    "rows": len(values),
    "columns": len(values[0]),
    "append": True,
    "values": values
}
res = gdoctableapp.CreateTable(resource)
print(res)

References:

Creating a Table to Google Document by Retrieving Values from Google Spreadsheet for Node.js

Gists

This is a sample script for creating a table to Google Document by retrieving values from Google Spreadsheet for Node.js.

Before you use this script, please install Node.js module of node-gdoctableapp.

$ npm install --save-dev gdoctableapp

or

$ npm install --global gdoctableapp

Sample script:

This sample script uses Service Account.

In this sample script, the values are retrieved from Sheet1!A1:C5 of Spreadsheet, and new table is created to the Document using the values.

python library - gdoctableapppy

Overview

This is a python library to manage the tables on Google Document using Google Docs API.

Description

Google Docs API has been released. When I used this API, I found that it is very difficult for me to manage the tables on Google Document using Google Docs API. Although I checked the official document, unfortunately, I thought that it’s very difficult for me. So in order to easily manage the tables on Google Document, I created this library.

node module - node-gdoctableapp

Overview

This is a Node.js module to manage the tables on Google Document using Google Docs API.

Description

Google Docs API has been released. When I used this API, I found that it is very difficult for me to manage the tables on Google Document using Google Docs API. Although I checked the official document, unfortunately, I thought that it’s very difficult for me. So in order to easily manage the tables on Google Document, I created this library.

Go Library - go-gdoctableapp

Overview

This is a Golang library for managing tables on Google Document using Google Docs API.

Description

Google Docs API has been released. When I used this API, I found that it is very difficult for me to manage the tables on Google Document using Google Docs API. Although I checked the official document, unfortunately, I thought that it’s very difficult for me. So in order to easily manage the tables on Google Document, I created this library.

Creating New Table and Putting Values to Cells using Google Docs API with Google Apps Script

Gists

This is a sample script for creating new table and putting values to cells using Google Docs API with Google Apps Script. Unfortunately, in the current stage, although I had been looking for the method for creating a table and putting the values in each cell at the official document, I couldn’t find. Google Docs API is growing now. So such documents might be not prepared yet. By this situation, I investigated about the method for achieving this method.