ravio1i / notion-gcal-sync Goto Github PK
View Code? Open in Web Editor NEWPython application to bidirectional synchronize calendar events within notion and google calendar
License: GNU General Public License v3.0
Python application to bidirectional synchronize calendar events within notion and google calendar
License: GNU General Public License v3.0
The time change from summer and winter breaks the event times.
E.g
Europe/Berlin
end with +02:00
+01:00
The current implementation creates wrong times in notion, creating events with 1 hour off.
Add possiblity to run the synchronization with verbose information
$ notion-gcal-sync -v
2021-10-18 09:03:01,780 [DEBUG] SUCH AN IMPORTANT DEBUG MESSAGE
When an event gets created in notion from a GCal event its something like
https://www.notion.so/subdomain/event_bla_abcd123
When updated the api gives the url without subdomain
https://www.notion.so/event_bla_abcd123
This causes new events from GCAl to be created then set to sync error and the updated again.
This sync is currently available as an one-time job. If a sync is needed, it just needs to be executed
The more likely usage is a continuously running job synchronizing the sources.
Currently to delete an event it must be marked in Notion as deleted, because the notion api does not support delete.
When deleting an event in Google calendar it will just be recreated from notion.
Searching for cancelled
events in a short timeframe can indicate deleted events in Google calendar.
Currently all events of notion and gcal are fetched and then synchronized. To increase performance limit timeframe
Give options, like "Week", "Month" ...
Currently the setup takes too much manual effort. Let's automate some of it 🥳
Running the script detects the config file aswell as the credentials and lets the user input the wanted configurations
When trying to update events on GCal where you are not creator (events where people get invited), you cannot update the event.
2021-10-28 08:24:49,920 [WARNING] Encountered 403 Forbidden with reason "forbiddenForNonCreator"
Traceback (most recent call last):
File "/home/***/anaconda3/envs/notion-gcal-sync/bin/notion-gcal-sync", line 5, in <module>
main()
File "/home/***//Workspace/github.com/notion-gcal-sync/notion_gcal_sync/__main__.py", line 21, in main
sync(cfg)
File "/home/***//Workspace/github.com/notion-gcal-sync/notion_gcal_sync/core.py", line 257, in sync
create_notion_events(df, gcal_client, notion_client, gcal_df, gcal_specific_columns)
File "/home/***//Workspace/github.com/notion-gcal-sync/notion_gcal_sync/core.py", line 70, in create_notion_events
gcal_event_res = gcal_client.update_event(gcal_event)
File "/home/***//Workspace/github.com/notion-gcal-sync/notion_gcal_sync/clients/GCalClient.py", line 132, in update_event
self.service.events()
File "/home/***//anaconda3/envs/notion-gcal-sync/lib/python3.9/site-packages/googleapiclient/_helpers.py", line 131, in positional_wrapper
return wrapped(*args, **kwargs)
File "/home/***//anaconda3/envs/notion-gcal-sync/lib/python3.9/site-packages/googleapiclient/http.py", line 937, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/calendar/v3/calendars/***/events/***?alt=json returned "
The operation can only be performed by the creator of the event.".
Details: "[{'domain': 'calendar', 'reason': 'forbiddenForNonCreator', 'message': 'The operation can only be performed by the creator of the event.'}]">
As its indictaes only the creator should be able to change the event.
Treat events where you are not the creator as read_only
The description of gcal description allows longer texts than notion
notion_client.errors.APIResponseError: body failed validation: body.properties.Description.rich_text[0].text.content.length should be ≤ `2000`, instead was `2088`.
Traceback (most recent call last):
File "/home/***/anaconda3/envs/notion-gcal-sync/lib/python3.9/site-packages/notion_client/client.py", line 115, in _parse_response
response.raise_for_status()
File "/home/***/anaconda3/envs/notion-gcal-sync/lib/python3.9/site-packages/httpx/_models.py", line 1105, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: 400 Client Error: Bad Request for url: https://api.notion.com/v1/pages
For more information check: https://httpstatuses.com/400
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/***/anaconda3/envs/notion-gcal-sync/lib/python3.9/site-packages/notion_client/client.py", line 122, in _parse_response
raise APIResponseError(response, body["message"], code)
notion_client.errors.APIResponseError: body failed validation: body.properties.Description.rich_text[0].text.content.length should be ≤ `2000`, instead was `2088`.
Events in google chalendar have colors. Why not apply this somehow in Notion aswell 🌈
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.