GithubHelp home page GithubHelp logo

ravio1i / notion-gcal-sync Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 2.0 488 KB

Python application to bidirectional synchronize calendar events within notion and google calendar

License: GNU General Public License v3.0

Dockerfile 0.47% Python 99.53%
python notion notion-api gcal gcalendar synchronization

notion-gcal-sync's People

Contributors

actions-user avatar ravio1i avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

notion-gcal-sync's Issues

Bug: time change causes wrong event times

The time change from summer and winter breaks the event times.

E.g

  • Times in summer in timezone Europe/Berlin end with +02:00
  • Time in winter time end with +01:00

The current implementation creates wrong times in notion, creating events with 1 hour off.

Add verbose mode

Description

Add possiblity to run the synchronization with verbose information

Possible Implementations

$ notion-gcal-sync -v

2021-10-18 09:03:01,780 [DEBUG]  SUCH AN IMPORTANT DEBUG MESSAGE

Feature: Add deployment/service options for continuous running

Description

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.

Possible implementation

  • Cronjob running this the script every ... timeslot (+ runs easily in container)
  • Systemd service
  • Python loop
  • Event based (Way more effort) -> maybe a different Feature: Event based synchronization

Deleting an event in google calendar should delete an event in Notion

Description

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.

Possible Solution

Searching for cancelled events in a short timeframe can indicate deleted events in Google calendar.

Add automatic setup

Description

Currently the setup takes too much manual effort. Let's automate some of it 🥳

Possible solution

Running the script detects the config file aswell as the credentials and lets the user input the wanted configurations

Bug: Encountered 403 Forbidden with reason "forbiddenForNonCreator"

Description

When trying to update events on GCal where you are not creator (events where people get invited), you cannot update the event.

Error Message

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.

Possible Fix

Treat events where you are not the creator as read_only

Description of GCal event is too long for notion rich_text

Description

The description of gcal description allows longer texts than notion

Error

notion_client.errors.APIResponseError: body failed validation: body.properties.Description.rich_text[0].text.content.length should be ≤ `2000`, instead was `2088`.

Debug Output

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`.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.