Uses gspread and oauth2client libraries
Setup:
- Clone the repo.
- Open
https://console.developers.google.com/apis
on your browser and create a project. - On the Dashboard, add google drive api to your project
- Go to "Credentials" and put "Web Server" on the "Where you will be accessing the api from?"
- Give access to "Application data" and "No I'm not using them"
- Click on "What credentials do I need?"
- Create a service account giving it a name and give it a role of "Editor"
- Click "Continue" which will download a json file, rename it to anything you want and move it to the directory where you cloned the repo.
- Open the json file and copy the
client_email
. - Create a google spreadsheet at
https://docs.google.com/spreadsheets
(Skip this if you already have a google spreadsheet) - On your spreadsheet, share it to the
client_email
- Open spreadsheet.py and change
gglspreadsheet = 'To-do list'
togglspreadsheet = 'your_google_spreadsheet_name'
and changejsonFile = 'Todo.json'
tojsonFile = 'name_of_json_file_you_downloaded.json'
- Open terminal and run
python spreadsheet.py