pygsheets- Google Spreadsheets Python API v4
Python 2.6+ or 3+
pip install pygsheets
pip install https://github.com/nithinmurali/pygsheets/archive/master.zip
To programmatically access your spreadsheet, you’ll need to create a service account and OAuth2 credentials from the Google API Console.
- Go to the Google APIs Console and create a new project (or select the one you have.).
- You will be redirected to the API Manager, there Under “Library”, Google APIs click on “Sheets API”.
- Click Enable API. Search for “Drive API” and enable the Google Drive API.
- Create credentials for a Web Server to access Application Data.
- Go to “Credentials” Tab and choose “Create Credentials > OAuth Client ID”.
- Download the JSON file.
- Copy the JSON file to your code directory and rename it to
gc = pygsheets.authorize(outh_file='client_secretxxx.json')