cancerDHC / sheet2linkml

Python package for conversion of Google Sheet to LinkML for CCDH
Apache License 2.0
1 stars 3 forks source link

how does sheet2linkml get spreadsheetId? #5

Closed turbomam closed 3 years ago

turbomam commented 3 years ago

% sheet2linkml --output crdch_model.yaml --logging-config logging.ini

Please go to this URL and finish the authentication flow...

That works!

Traceback (most recent call last): File "/Users/MAM/Documents/gitrepos/sheet2linkml/.venv/bin/sheet2linkml", line 8, in sys.exit(main()) File "/Users/MAM/Documents/gitrepos/sheet2linkml/.venv/lib/python3.9/site-packages/click/core.py", line 1137, in call return self.main(args, kwargs) File "/Users/MAM/Documents/gitrepos/sheet2linkml/.venv/lib/python3.9/site-packages/click/core.py", line 1062, in main rv = self.invoke(ctx) File "/Users/MAM/Documents/gitrepos/sheet2linkml/.venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/Users/MAM/Documents/gitrepos/sheet2linkml/.venv/lib/python3.9/site-packages/click/core.py", line 763, in invoke return __callback(args, kwargs) File "/Users/MAM/Documents/gitrepos/sheet2linkml/.venv/lib/python3.9/site-packages/sheet2linkml/cli.py", line 64, in main model = GSheetModel(google_api_credentials, google_sheet_id) File "/Users/MAM/Documents/gitrepos/sheet2linkml/.venv/lib/python3.9/site-packages/sheet2linkml/source/gsheetmodel/gsheetmodel.py", line 53, in init self.sheet = self.client.open_by_key(google_sheet_id) File "/Users/MAM/Documents/gitrepos/sheet2linkml/.venv/lib/python3.9/site-packages/pygsheets/client.py", line 159, in open_by_key response = self.sheet.get(key, File "/Users/MAM/Documents/gitrepos/sheet2linkml/.venv/lib/python3.9/site-packages/pygsheets/sheet.py", line 164, in get return self._execute_requests(self.service.spreadsheets().get(spreadsheetId=spreadsheet_id, kwargs)) File "/Users/MAM/Documents/gitrepos/sheet2linkml/.venv/lib/python3.9/site-packages/googleapiclient/discovery.py", line 1012, in method raise TypeError('Missing required parameter "%s"' % name) TypeError: Missing required parameter "spreadsheetId"

turbomam commented 3 years ago

From https://github.com/cancerDHC/ccdhmodel/blob/main/Makefile: CDM_GOOGLE_SHEET_ID=1oWS7cao-fgz2MKWtyr8h2dEL9unX__0bJrWKv6mQmM4

running this before the sheet2linkml command seems to work: export CDM_GOOGLE_SHEET_ID=1oWS7cao-fgz2MKWtyr8h2dEL9unX__0bJrWKv6mQmM4

Should CDM_GOOGLE_SHEET_ID go in the .env file? Or be documented in the README?