How do I rename a (work)sheet in a Google Sheets spreadsheet using the API in Python?

This is an extraction of a library which I’ve coded personally: def _batch(self, requests): body = { ‘requests’: requests } return self._service.spreadsheets().batchUpdate(spreadsheetId=self.spreadsheetId, body=body).execute() def renameSheet(self, sheetId, newName): return self._batch({ “updateSheetProperties”: { “properties”: { “sheetId”: sheetId, “title”: newName, }, “fields”: “title”, } }) I think that with a little effort, you can implement it into your … Read more

How do I get user profile using Google Access Token

I had the same issue. I wanted to extract the user information. But couldn’t get the exact link to hit. Then I went through the code for Passport Google Strategy at Line number 54. My scopes were [‘profile’, ’email’] GET Request https://www.googleapis.com/oauth2/v3/userinfo?access_token={access_token} Response { “sub”: “23423….”, “name”: “John Doe”, “given_name”: “John”, “family_name”: “Doe”, “picture”: “<Profile … Read more

Content Security Policy: cannot load Google API in Chrome extension

I wrestled with this issue for the past 12 hours and finally got it to work. Why did it take so long? Because I got thrown off the trail multiple times. First, the false leads: “Make it HTTPS” — Doesn’t matter. My Chrome extension now makes regular HTTP calls to a different domain and works … Read more

tech