vibalcam / ticktick-gcalendar-py

2-way sync between TickTick and Google Calendar
MIT License
35 stars 2 forks source link
googlecalendar googlecalendarapi sync ticktick ticktick-list

TickTick-GoogleCalendar-sync

This script provides 2-way sync between TickTick and Google Calendar.

To provide "continuous" 2-way sync, it can be programmed to run every few minutes using crontab or any other program that allows running Python scripts.

Installation

  1. Create conda environment

    conda create -n tick python=3.9.5
    conda activate tick
  2. Clone the repository

    git clone https://github.com/vibalcam/ticktick-gcalendar-py.git
  3. Install the required packages

    pip install -r requirements.txt
  4. Install ticktick_py fork (i.e., clone and install requirements). This fork solves a minor unresolved issue in the original repository (as of April 13, 2024)

    git clone https://github.com/vibalcam/ticktick_py.git
    pip install -r ticktick_py/requirements.txt
  5. Meet requirements (see below)

Requirements

Meet the following requirements:

Usage

  1. Check TickTick lists' ids
    python ticktick-gcalendar.py -p
  2. Set up account_info.py
  3. Renew tokens
    python ticktick-gcalendar.py -r
  4. Sync Google Calendar and TickTick
    python ticktick-gcalendar.py

After syncing, the program uses a few files to save the current state of synchronization. If these files are removed, the script will perform a full synchronization the next time it is run.

Reset Synchronization

To reset the synchronization, first remove all the synchronized events in Google Calendar. This can be done by running

python ticktick-gcalendar.py --delete_all_gcal

Fix Errors

It may happen that the script is not able to synchronize an event. To force synchronization of a specific event, we first need to remove it from memory and then sync again. The event ids can be obtained by looking at the error message after synchronizing.

# to remove a google calendar event (-rg)
python ticktick-gcalendar.py --remove_gcal 'gcal_event_id'
# to remove a google calendar event (-rt)
python ticktick-gcalendar.py --remove_tick 'tick_event_id'
# sync to force synchronize the removed events
python ticktick-gcalendar.py

Features

It uses the package ticktick-py and Google Calendar for python to sync between Ticktick and Google Calendar.

It is set up so the sync occurs in the following way:

Warnings

Packages