2 Way Sync Between Notion Database and Google Calendar

Overview

Notion-and-Google-Calendar-2-Way-Sync

2 Way Sync Between a Notion Database and Google Calendar

WARNING: This repo will be undergoing a good bit of change to make more accessible for users of all skill levels. This is not a finished product and if you have suggestions, I would love them!

https://www.youtube.com/watch?v=j1mh0or2CX8 This video was used to make the Google Calendar token. Note that the library names that they "pip installed" are outdated so look at the python file to see what you'll actually need to pip install onto your computer.

The Google Calendar token is what allows for the python code to access your Google Calendar and communicate with the Google Calendar servers to add/receive/modify data.

You'll need to make your GCal token before setting up the rest of the Python script. Use the GCalToken.py file to create your token when you have downloaded the JSON credentials (follow the above youtube video).

I'm not sure if this is the first one out there, but it is the only 2-way synchronous project I could find so that's pretty cool :)

The functionalities:

  • Take existing events from your Notion Dashboard and bring them over to Google Calendar
  • If the Notion event has only a date, then the GCal event is made at 8 am
  • If the Notion even has a date and time, then the GCal event is made at the appropriate time
  • If the event is already in both GCal and Notion, but you switch the date/time on either, it will sync with the new value across both platforms
  • If the event is only in GCal, it will be brought over to Notion, as well as the description of the event that you add from GCal

When making events, the code will extract the event name, date/time, a category, and text from the Notion Dashboard and integrate that information into your GCal event. Additionally, it will also add a URL source code the GCal event so you can click on the URL and automatically be brought over to the specific Notion Page that your event is at.

Some more visibility through some upvotes on my Reddit post would be appreciated and I think may bring along some new users to this resource! Reddit Post

Comments
  • End Time Notion not appearing in GCal

    End Time Notion not appearing in GCal

    Hey! Thank you so much for this project! This is exactly what I have been looking for.

    I however encouter a problem with the endtimes of events in Notion. If I've read it correctly in the added features you have mentioned that endtimes should be synced both ways. This works when I create an event in GCal; it shows up correctly. But if I enter an endtime in Notion it ends up with the default 60 minutes duration in GCal.

    Do I have to adjust something in the code to make this work? I have read the code from top to bottom but can't seem to find the place where this should be adjusted.

    opened by Sjaakie-stud 6
  • Problem bringing GCal events to Notion

    Problem bringing GCal events to Notion

    Notion feeds GCal perfectly, but when I run Part 4: Bring events (not in Notion already) from GCal to Notion it gives me this error: File "Notion-GCal-2WaySync-Public.py", line 1253, in calName = [item['summary'] for item in calItems] File "Notion-GCal-2WaySync-Public.py", line 1253, in calName = [item['summary'] for item in calItems] KeyError: 'summary' I'm kinda a python newbie, so I'd be grateful for any help ;)

    opened by szymonpindur 3
  • Make this work with Project relation

    Make this work with Project relation

                    el["properties"][Initiative_Notion_Name]["select"]["name"] # TODO: Make this work with Project relation
    

    https://github.com/SG60/Notion-and-Google-Calendar-2-Way-Sync/blob/f047236671304266579fd74e4ac24054ee97ea14/notion_gcal_sync/cli.py#L547

    opened by SG60 2
  • Traceback Error - Index Error: List Index out of Range

    Traceback Error - Index Error: List Index out of Range

    Traceback (most recent call last): File "C:\Users\User\Downloads\Notion-and-Google-Calendar-2-Way-Sync\Notion-GCal-2WaySync-Public.py", line 728, in CurrentCalList.append(el['properties'][Current_Calendar_Id_Notion_Name]['rich_text'][0]['text']['content']) IndexError: list index out of range

    I always get this error when running the python, but the code works except for syncing my second calendar. Both calendars are mine.

    P.S. I don't think it's a bug but I needed help so posted this here.

    opened by gkylelorenz01 2
  • Existing tasks will be duplicated  if there are more than 100 tasks in Notion's database

    Existing tasks will be duplicated if there are more than 100 tasks in Notion's database

    Thanks again for the great code.

    Now, when I was running this code, it sometimes generated duplicate tasks in the database. Apparently, there is a problem with the procedure in Part 4 that looks for calendar events that don't exist in Notion.

    my_page = notion.databases.query( **{ "database_id": database_id, "filter": { "property": GCalEventId_Notion_Name, "text": { "is_not_empty": True } } }, )

    In the Notion API, query responses are limited to 100 at a time. If there are more than 101 tasks, the IDs contained in the 101st task will not be used for comparison. Therefore, the program will overlook the IDs that should already be there, so it will add a new column of Notion.

    I can't think of a solution right away, so I'll post it in an issue.

    opened by JulyFaraway 1
  • Setup fixes

    Setup fixes

    Hey, thanks for making this! It seems super useful and I can't wait to set it up and see more features in the future 🤩

    I just finished setting it up and ran into a couple of bugs and missing dependencies along the way, so I thought I would just share them for anyone else having similar issues.

    opened by gracewgao 1
  • Adding notion link in descripton columns

    Adding notion link in descripton columns

    Hi, thanks for your amazing script. It did help a lot.

    But there's a little inconvenient when navigating to notion page, I was wondering is any possible adding notion direct link url like "https://www.notion.so/XXXXXX" in description column for direct link, Thx.

    opened by ianzhuo 0
  • Added basic external organizer functionality. Previously, if one of t…

    Added basic external organizer functionality. Previously, if one of t…

    Hello! I was setting up your wonderful syncing tool and I noticed I kept getting errors. After investigating, I realized what was happening: The code was failing on Step 4 "Bring Events not in notion from GCAL to Notion".

    It turns out that the issue was that I was trying to import events (in my gcal) that were made by other people , external organizers)as I call them.

    These are added to the gCal_calendarID list but are not apart of the calendar dictionary (as I do not have permission to write to these calendars). Therefore, when trying to access calIds.index(external organizer) the code threw a Value Error. The solution I came up with is simply to add these events to the default calendar. This is a pretty naïve solution, but it makes the code operational. To do this I made an organizer_map() function, which you can find where gCal_calendarName is set.

    Thank you for your time

    opened by Mishark-dev 0
  • Misc Changes

    Misc Changes

    Migrated most of the configuration to an INI file which should make it more friendly for users. Also did a lot of refactoring using an automated tool that should cut down on redundancies.

    Changed the calendar token generation process to use a local server instead of client. This removes the need to copy paste in a token key yourself into the console. The client system also had some errors on my side on not recognizing scope.

    Fixed a bug where it would look for organizers instead of creator when creating gCal_calendarId. Organizer is unrelated to the actual calendar itself, and if this were an autogenerated event, from say an email invite or from Google, the organizer would be from an email not registered in the dictionary resulting in an error.

    opened by hk21702 0
  • TypeError: string indices must be integers

    TypeError: string indices must be integers

    Notion-GCAl-Sync Iccue

    The above error occurs when I run the script while Google Calendar is syncing tasks (not already in my Notion database) to my Notion database. Can't seem to figure out the issue.

    opened by michaeltu01 0
  • ValueError(

    ValueError("unconverted data remains: %s" and HttpError 404 when requesting https://www.googleapis.com/calendar/v3/calendars

    I receive following errors: 1)File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/_strptime.py", line 352, in _strptime raise ValueError("unconverted data remains: %s" % ValueError: unconverted data remains: T13:00:00.000-04:00

    1. File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/googleapiclient/http.py", line 935, in execute raise HttpError(resp, content, uri=self.uri) googleapiclient.errors.HttpError: <HttpError 404 when requesting https://www.googleapis.com/calendar/v3/calendars/3cq0v2l8n197dmrie8l7vhjlj0%40group.calendar.google.com/events/3p10s2o3lst5mhtfkv3v23mvt4/move?destination=njgl69md8r5ckbspstljs3bqug%40group.calendar.google.com&alt=json returned "Not Found". Details: "[{'domain': 'global', 'reason': 'notFound', 'message': 'Not Found'}]">

    Can anybody help?

    opened by miroslavTkachenko 0
  • googleapi calendar_id has changed

    googleapi calendar_id has changed

    Hi, I am unable to find my calendar id. It appears as for the "main" calendar, the calendar id is just the email address, ie "[email protected]" Thus I'm unable to plug the id in the code. Someone was able to integrate the script with their "main" calendar?

    Any help? Thanks

    opened by dvirginz 1
  • TaskNames.append(el['properties'][Task_Notion_Name]['title'][0]['text']['content']) KeyError: 'title'

    TaskNames.append(el['properties'][Task_Notion_Name]['title'][0]['text']['content']) KeyError: 'title'

    Hey @akarri2001. This is an amazing project but I'm unable to run it because of so many errors. I followed the docs and changed the token etc. Kindly fix this error. If possible can you make YouTube Tutorial on How to configure this project step by step because from docs I got stuck in between. Thank you

    Traceback (most recent call last): File "E:\Python Work\Notion & Google calender\Notion-and-Google-Calendar-2-Way-Sync\Notion-GCal-2WaySync-Public.py", line 738, in TaskNames.append(el['properties'][Task_Notion_Name]['title'][0]['text']['content']) KeyError: 'title'

    opened by DawnSaju 0
Owner
null
Replit theme sync; Github theme sync but in Replit.

This is a Replit theme sync, basically meaning that it keeps track of the current time (which may need to be edited later on), and if the time passes morning, afternoon, etc, the theme switches. The idea came from GitHub's theme sync. Except this is a separate program, not attached to Replit.

Glitch 8 Jun 25, 2022
An awesome script to convert the University Of Oviedo web calendar to Google or Outlook calendars.

autoUniCalendar Un script en Python para convertir el calendario de la intranet de la Universidad de Oviedo en un calendario de Outlook o Google Calen

Bimo99B9 14 Sep 28, 2022
A flexible free and unlimited python tool to translate between different languages in a simple way using multiple translators.

deep-translator Translation for humans A flexible FREE and UNLIMITED tool to translate between different languages in a simple way using multiple tran

Nidhal Baccouri 806 Jan 4, 2023
Write Streamlit apps using Notion! (Prototype)

Streamlit + Notion test app Write Streamlit apps using Notion! ☠️ IMPORTANT: This is just a little prototype I made to play with some ideas. Not meant

Thiago Teixeira 22 Sep 8, 2022
This an Anki add on that automatically converts Notion notes into Anki flash cards. Currently in development!

NotionFlash This is an Anki add on in development that will allow automatically convert your Notion study notes into Anki flash cards. The Anki deck c

Neeraj Patel 10 Oct 7, 2022
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Advent Of Code 2021 - Python English Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels th

Coral Izquierdo Muñiz 2 Jan 9, 2022
An Advent calendar of small programming puzzles for a variety of skill sets and skill levels.

Advent of Code 2021 The Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be sol

Evan Cope 0 Feb 13, 2022
An easy way to access to your EPITECH subjects based on the Roslyn's database.

An easy way to access to your EPITECH subjects based on the Roslyn's database.

Mathias 1 Feb 9, 2022
- Auto join teams teams ( from calendar invite )

Auto Join Teams Meetings Requirements: Python 3.7 or higher Latest Google Chrome This script automatically logins to your account and joins the meetin

Prajin Khadka 10 Aug 20, 2022
Run-Your-Own Firefox Sync Server

Run-Your-Own Firefox Sync Server This is an all-in-one package for running a self-hosted Firefox Sync server. It bundles the "tokenserver" project for

Mozilla Services 1.7k Dec 30, 2022
Sync SiYuanNote & Yuque.

SiyuanYuque Sync SiYuanNote & Yuque. Install Use pip to install. pip install SiyuanYuque Execute like this: python -m SiyuanYuque Remember to create a

Clouder 23 Nov 25, 2022
use Notepad++ for real-time sync after python appending new log text

FTP远程log同步工具 使用Notepad++配合来获取实时更新的log文档效果 适用于FTP协议的log远程同步工具,配合MT管理器开启FTP服务器使用,通过Notepad++监听文本变化,更便捷的使用电脑查看方法注入打印后的信息 功能 过滤器 对每行要打印的文本使用回调函数筛选,支持链式调用

Liuhaixv 1 Oct 17, 2021
An application to see if your Ethereum staking validator(s) are members of the current or next post-Altair sync committees.

eth_sync_committee.py Since the Altair upgrade, 512 validators are randomly chosen every 256 epochs (~27 hours) to form a sync committee. Validators i

null 4 Oct 27, 2022
A(Sync) Interface for internal Audible API written in pure Python.

Audible Audible is a Python low-level interface to communicate with the non-publicly Audible API. It enables Python developers to create there own Aud

mkb79 192 Jan 3, 2023
🔵Open many google dorks in a fasted way

Dorkinho ?? The author is not responsible for misuse of the tool, use it in good practices like Pentest and CTF OSINT challenges. Dorkinho is a script

SidHawks 2 May 2, 2022
Run python scripts and pass data between multiple python and node processes using this npm module

Run python scripts and pass data between multiple python and node processes using this npm module. process-communication has a event based architecture for interacting with python data and errors inside nodejs.

Tyler Laceby 2 Aug 6, 2021
Interfaces between napari and pymeshlab library to allow import, export and construction of surfaces.

napari-pymeshlab Interfaces between napari and the pymeshlab library to allow import, export and construction of surfaces. This is a WIP and feature r

Zach Marin 4 Oct 12, 2022
This library is an ongoing effort towards bringing the data exchanging ability between Java/Scala and Python

PyJava This library is an ongoing effort towards bringing the data exchanging ability between Java/Scala and Python

Byzer 6 Oct 17, 2022
pybind11 — Seamless operability between C++11 and Python

pybind11 — Seamless operability between C++11 and Python Setuptools example • Scikit-build example • CMake example pybind11 is a lightweight header-on

pybind 12.1k Jan 8, 2023