-
Notifications
You must be signed in to change notification settings - Fork 2
04‐API
Teeraphat Kullanankanjana edited this page Oct 28, 2023
·
9 revisions
from ggsheet import MicroGoogleSheet
MicroGoogleSheet(googleSheetURL
, sheet_name
, deploymentID
)
Initializes the MicroGoogleSheet class with the Google Sheet URL, sheet name, and deployment ID.
Parameters
-
googleSheetURL
(str): The URL of the Google Sheet. -
sheet_name
(str, optional): The name of the sheet within the Google Sheet. Default is "Sheet1". -
deploymentID
(str, optional): The deployment ID of the Google Apps Script web app. The default is an empty string, which can be added later with set_DeploymentID().
# Google Sheet Credential
google_sheet_url = "https://docs.google.com/spreadsheets/d/xxxxxxxxx/edit#gid=0"
google_sheet_name = "Sheet1"
google_app_deployment_id = "xxxxxxxx"
# Create Instance
ggsheet = MicroGoogleSheet(google_sheet_url,google_sheet_name,google_app_deployment_id)
set_DeploymentID(deployment_id
)
Sets the deployment ID for the Google Apps Script web app.
Parameters
-
deployment_id
(str): The deployment ID to set.
# Google Sheet Credential
google_sheet_url = "https://docs.google.com/spreadsheets/d/xxxxxxxxx/edit#gid=0"
google_sheet_name = "Sheet1"
google_app_deployment_id = "xxxxxxxx"
ggsheet = MicroGoogleSheet(google_sheet_url,google_sheet_name)
ggsheet.set_DeploymentID(google_app_deployment_id)
set_SheetName(sheetName
)
Sets the name of the sheet within the Google Sheet.
Parameters
- sheetName (str): The sheet name to set.
# Google Sheet Credential
google_sheet_url = "https://docs.google.com/spreadsheets/d/xxxxxxxxx/edit#gid=0"
google_sheet_name = "Sheet1"
google_app_deployment_id = "xxxxxxxx"
# Class Instance
ggsheet = MicroGoogleSheet(google_sheet_url,google_sheet_name)
# Set Deployment ID
ggsheet.set_DeploymentID(google_app_deployment_id)
# Set the sheet name from "Sheet1" to "Sheet2"
ggsheet.set_SheetName("Sheet2")
gen_scriptFile()
Generate a Google Apps Script file for Google Sheet operations.
# Google Sheet Credential
google_sheet_url = "https://docs.google.com/spreadsheets/d/xxxxxxxxx/edit#gid=0"
# Class Instance
ggsheet = MicroGoogleSheet(google_sheet_url)
# Generate Google Script File
ggsheet.gen_scriptFile()
The
Python Code
Python Code
Python Code
Python Code
Python Code
Python Code
Python Code
Python Code
Python Code
Python Code
Python Code
Python Code
Python Code
Python Code
Python Code