forked from miguelgrinberg/flask-gridjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoogle_sheets_test.py
More file actions
59 lines (32 loc) · 1.36 KB
/
Copy pathgoogle_sheets_test.py
File metadata and controls
59 lines (32 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import os
import sqlite3
from datetime import datetime, timedelta
import pandas as pd
from dotenv import load_dotenv
from gspread_pandas import Spread
load_dotenv()
load_dotenv(".env.googlesheets")
CONED_SPREADSHEET_COPY = os.getenv("CONED_SPREADSHEET_COPY")
TILLER_SPREADSHEET_COPY = os.getenv("TILLER_SPREADSHEET_COPY")
QUIRK_CLASS_LIST = os.getenv("QUIRK_CLASS_LIST")
def main():
# spread = Spread(QUIRK_CLASS_LIST)
# spread.open_sheet("All Info")
# last_existing_row = spread.get_sheet_dims()[0]
# starting_row = last_existing_row + 1
# df = spread.sheet_to_df(index=None)
# print(df)
# with sqlite3.connect("quirk_list.db") as conn:
# df.to_sql("quirk_list", conn, if_exists="replace")
with sqlite3.connect("quirk_list.db") as conn:
df = pd.read_sql("SELECT * from quirk_list", conn)
print(df)
# df_new = pd.read_csv("test.csv", index_col=0)
# # df = pd.concat([df, df_new], ignore_index=True)
# spread.df_to_sheet(df_new, index=False, headers=False, start=(starting_row, 1))
# # Save DataFrame to worksheet 'New Test Sheet', create it first if it doesn't exist
# spread.df_to_sheet(df, index=False, sheet='New Test Sheet', start='A1', replace=True)
# Make columns bold!
# spread.sheet.format('A1:AL1', {'textFormat': {'bold': True}})
if __name__ == "__main__":
main()