-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (19 loc) · 727 Bytes
/
Copy pathmain.py
File metadata and controls
28 lines (19 loc) · 727 Bytes
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
import logging
from config import GoogleSheetsApiAuth, sheet_id
from fold import FoldProcess
from insert_data import CopyToNewPage
from sorting import CellSorter
def main() -> None:
# Auth
client, service = GoogleSheetsApiAuth.get_google_services()
# Open Google Sheet by Sheet id
spreadsheet = client.open_by_key(sheet_id).sheet1
data, ref_column, type_column = GoogleSheetsApiAuth.get_sheet(spreadsheet)
# Sorting
CellSorter.sort_data(spreadsheet)
# Process to Fold lines
edited_rows = FoldProcess.process_table(data)
# Insert fold data into Result page
CopyToNewPage.copy_to_result_sheet(service, sheet_id, spreadsheet, edited_rows)
if __name__ == "__main__":
main()