A one-way sync between Google Calendar events and Todoist.
This script aims to mimick TickTick's Google Calendar sync.
Tasks created by this script are uncompletable and preceded by "🗓️", having the event start date as their due date, they are also added to their own project and assigned a custom label. Also a comment is added to each task with the events location and description.
Multiple day events get a task for each day, with older tasks getting completed each day.
Once an event is over, all tasks related to it will be automatically completed.
A docker-compose.yml
example file is provided within this repo. Use it to get started faster.
Make sure to setup your credentials folder and configs.yml
You will need:
- Python 3.10+
- A
clone
of this repo - Run
pip install -r requirements.txt
- .credentials folder on the root of the script folder with your Google Calendar authentication files
- Configure configs.yml
- Run
gcal2todoist.py
Please refer to Google Calendar Simple API's docs for a guide on how to create the .credentials
folder
Rename configs.yml.example
to configs.yml
and edit accordingly
todoist_api_token: "YOUR_TODOIST_TOKEN_GENERATED_ON_THE_WEB_CLIENT"
default_project: "Events" # Name of the project you want your tasks to get added to. It will be created if it doesn't exist.
label: "Event" # Custom label to be added to each task created by the script.
keep_running: false # If false, script will run only once. Else it will run every n seconds
run_every: 600 # seconds
log_level: "INFO" # Currently only INFO level logs are avaliable.
completed_label: "Done" # Add this label to a event to complete it before it's given time (useful for full day events)
# Will fetch this number of days in advance. The higher this number
# the higher the amount of api calls, watch out for rate limiting
days_to_fetch: 7
To sync a calendar
- Create a Todoist Project with the same name as the
default_project
set onconfigs.yml
. - Add a new project as a child of the default project (one project for each calendar you want to sync)
Due to the lack of a start and end date on Todoist tasks, syncing with Google Calendar poses an interesting challenge, if you feel like you can improve this script please open an issue or a pull request, they are very much welcome.
For major changes, please open an issue first to discuss what you would like to change.