This script downloads, aggregates, and JSON-ifies content stored in a Google spreadsheet.
- Python 2.7
- gspread library (
pip install gspread
) - oauth2client (
pip install oauth2client
)
- Eanble Goolge SpreadSheet API and Google Drive API
- Make sure the credentials are for a service account.
- Your credentials should be saved as
keyfile.json
. The file should look like this
{
"type":"",
"project_id":"",
"private_key_id":"",
"private_key":"",
"client_email":"",
"client_id":"",
"auth_uri":"",
"token_uri":"",
"client_x509_cert_url":""
}
- Share the "client_email" with your spreadsheet to access the data via the python script
The example uses the credentials in keyfile.json
and writes JSON from the spreadsheet to temp_content.json
. The example also uses this spreadsheet as an example.
To run the script:
- Open terminal
- CD into the folder
- Run
python main.py keyfile.json temp_content.json
- google spreadsheet cms is distributed under the MIT license.