Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 22aed9c

Browse filesBrowse files
authored
Update README.md
1 parent 9ad06af commit 22aed9c
Copy full SHA for 22aed9c

File tree

Expand file treeCollapse file tree

1 file changed

+59
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+59
-0
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+59Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,62 @@
22
Update or append the data to Google Sheet, or get the data on Google Sheet.
33
By using HTTP to execute the Google Apps Script API.
44
Compatible with ESP32 and ESP8266.
5+
6+
# Quick Example
7+
```python
8+
# Import Library
9+
from ggsheet import MicroGoogleSheet
10+
from network import WLAN,STA_IF
11+
12+
# Network Creadential
13+
ssid = "Change SSID"
14+
password = "Change Password"
15+
16+
# Connect to Network
17+
sta_if = WLAN(STA_IF)
18+
sta_if.active(True)
19+
if not sta_if.isconnected():
20+
print("Connecting to wifi: ", ssid)
21+
sta_if.connect(ssid, password)
22+
while not sta_if.isconnected():
23+
pass
24+
print("Connection successful")
25+
26+
# Google Sheet Credential
27+
google_sheet_url = "https://docs.google.com/spreadsheets/d/xxxxxxxxx/edit#gid=0"
28+
google_sheet_name = "Sheet1"
29+
google_app_deployment_id = "xxxxxxxx"
30+
31+
# Create Instance
32+
ggsheet = MicroGoogleSheet(google_sheet_url,google_sheet_name)
33+
ggsheet.set_DeploymentID(google_app_deployment_id)
34+
35+
# create the Google App Script file (not necessary if it already exists).
36+
ggsheet.gen_scriptFile()
37+
38+
# Update the cell (single data into a single cell)
39+
ggsheet.updateCell(1,1,"Hello this is my first data")
40+
41+
# Get the data from specific cell
42+
print(ggsheet.getCell(1,1))
43+
44+
# Append the row (many data into a single row)
45+
ggsheet.updateRow(1,[1,2,3,"Hello","สวัสดีครับ"])
46+
47+
# Get all the data from a specific row
48+
print(ggsheet.getRow(1))
49+
```
50+
51+
# Getting Started
52+
- Installation
53+
- How to use
54+
55+
# Usage
56+
- Update Cell
57+
- Update Row
58+
- Update Column
59+
- Append Row
60+
- Append Column
61+
- Get Cell
62+
- Get Row
63+
- Get Column

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.