Spaces:
Sleeping
Sleeping
Keith Bourne commited on
Commit ·
492b682
1
Parent(s): 60632f7
Add google sheets test fix
Browse files- app.py +3 -3
- requirements.txt +4 -3
app.py
CHANGED
|
@@ -4,13 +4,13 @@ import pandas as pd
|
|
| 4 |
from streamlit_gsheets import GSheetsConnection
|
| 5 |
import os
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
|
| 10 |
# Create a connection object.
|
| 11 |
conn = st.connection("gsheets", type=GSheetsConnection)
|
| 12 |
|
| 13 |
-
df = conn.read()
|
| 14 |
|
| 15 |
# Print results.
|
| 16 |
for row in df.itertuples():
|
|
|
|
| 4 |
from streamlit_gsheets import GSheetsConnection
|
| 5 |
import os
|
| 6 |
|
| 7 |
+
# example of secret access
|
| 8 |
+
spreadsheet = os.environ['spreadsheet']
|
| 9 |
|
| 10 |
# Create a connection object.
|
| 11 |
conn = st.connection("gsheets", type=GSheetsConnection)
|
| 12 |
|
| 13 |
+
df = conn.read(spreadsheet=spreadsheet, usecols=[0, 1])
|
| 14 |
|
| 15 |
# Print results.
|
| 16 |
for row in df.itertuples():
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
-
streamlit
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
| 1 |
+
streamlit # this worked, but example gave one below: st-gsheets-connection
|
| 2 |
+
pandas
|
| 3 |
+
git+https://github.com/streamlit/gsheets-connection
|
| 4 |
+
pandasql # this is for example/st_app.py only
|