Skip to content

aakashadesara/notion-google-sheets-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 Notion x Google Sheets

This is a quick utlity to sync a Google Sheet with a Notion Collection. I primarily made it to automate some workflows for The Daily Dropout but thought it might be useful for other folks who use Notion + Sheets as part of their work tools.

Demo Notion Google Sheets Sync

How to Use Notion x Google Sync

  1. Make sure you have Python3 installed and use Python3 / Pip3 to install these packages:
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib      
pip install notion   
  1. Replace <YOUR_SPREADSHEET_ID> in sync.py with your Google Sheets Spreadsheet ID. In my case, the link was https://docs.google.com/spreadsheets/d/1-bj7rMv_TIC6IrwhsMcxVv6FJLVRv6jk6gjBWy7pNbQ/edit#gid=0 so I took everything after the /d/ and that was my Spreadsheet ID.

  2. Go through these steps set up by Google to let you use the Google Sheets API.

  3. Query the cells you want using Google Sheets syntax (ex. Sheet1!A1:AA) and replace <YOUR_SPREADSHEET_SELECTION> in the code with that query.

  4. Get your Notion V2 Token by visiting your Notion page from a browser and copy the token_v2 Cookie. Replace <YOUR_NOTION_TOKEN_V2> with the cookie.

  5. Make a new Notion page with a single Block (a Collection block) and copy your Notion page link and replace <YOUR_NOTION_PAGE_LINK> with the link. The Notion page you made should look like this:

Empty Page

  1. And you should be good to go! Now just run python sync.py and everything should work.

Work In Progress

This is in order of priority

  • Typing for Collection properties (so it's not just text)
  • better reloading (instead of deleting + re-populating Collection)
  • Chron job to automatically sync on a cadence
  • onChangeListener for Google Sheet (so users can toggle between Chron job and auto-sync)

If you want to help, feel free to fork + make a pull request. Contact me on Twitter @aakashadesara before you work on something big so we do not have multiple people working on the same changes.

Thanks

Special thanks to the folks working on the Notion Python API

About

Utility to Sync Google Sheets and Notion Collection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages