Quick code snippets for:
- Requesting data from Oura API
- Transforming in python
- Pushing to Google Sheets
Uses oura-ring wrapper for Oura API requests, and gspread for Google Sheets.
Verbose explanation in article.
- Set up prerequisites
- Get Oura API key
- Set up Google Sheet
- Make Google Cloud service account, download .json key
- Share sheet with service account
- Populate
config.py
with your information.
# Oura API key
oura_key = 'oura_key.txt'
# Google Cloud service account json
svc_acct_json = 'svc_acct.json'
# Google Sheets id (remember to share with service account)
sheet_id = '1WHzvsg2zmGwZm0YPpOuKQmvXJryml16HJ_ZpYyTKI5I' # example google sheet
# Google Sheets tab name
tab_name = 'data'
# How many days to update
days = 30
- Run
python update_sheets.py
or runnotebook.ipynb