Spaces:
Runtime error
Runtime error
Download quickstart.py from doyu/tinymlaas-devel: direct link, hf CLI and curl.
- Browser
- Download file 964 Bytes
-
https://huggingface.co/spaces/doyu/tinymlaas-devel/resolve/main/quickstart.py
- Command line
-
hf download hf://spaces/doyu/tinymlaas-devel/quickstart.py
-
curl -L -o quickstart.py https://huggingface.co/spaces/doyu/tinymlaas-devel/resolve/main/quickstart.py
964 Bytes
| from googleapiclient.discovery import build | |
| from google.oauth2 import service_account | |
| SERVICE_ACCOUNT_FILE = 'keys.json' | |
| SCOPES = ['https://www.googleapis.com/auth/spreadsheets'] | |
| creds = service_account.Credentials.from_service_account_file( | |
| SERVICE_ACCOUNT_FILE, scopes=SCOPES) | |
| # The ID of a sample spreadsheet. | |
| SPREADSHEET_ID = '1DNoNf4glcuMxKoVzHVrFo-MktmsVji1wf4IHeraWH84' | |
| service = build('sheets', 'v4', credentials=creds) | |
| # Call the Sheets API | |
| sheet = service.spreadsheets() | |
| result = sheet.values().get(spreadsheetId=SPREADSHEET_ID, | |
| range="A1:B2").execute() | |
| values = result.get('values', []) | |
| print(values) | |
| aoa = [["3/1/2022", 4000],["4/4/2022", 3000],["7/12/2022", 7000]] | |
| request = sheet.values().update(spreadsheetId=SPREADSHEET_ID, | |
| range="Sheet2!B2", valueInputOption="USER_ENTERED", | |
| body={"values":aoa}) | |
| response = request.execute() | |
| print(response) | |