Bi-directional syncing between Todoist and Google Calendar
First and foremost, why ... use Google Calendar with Todoist?
The norm for a To-do app is to display tasks in a linear fashion; yet, one can't help but realize how overwhelming this approach may turn out to be. Nonetheless, Visualization is a plausible solution to this challenge; through this integration, one can visualize and plan ahead by looking at a bird's eye view of the whole landscape available for work.
The instructions below will help you get the tool up and running.
Note: The daemon has only been tested with unix-based systems and python 3.x.
For an always up-to-date list of dependencies - see dependencies.txt
Install dependencies using:
pip3 install -r ./misc/dependencies.txt
- Clone the repo and change dir.
git clone https://github.com/alexandrosio/todoist_gcal_sync.git
cd ./todoist_gcal_sync
- Create the credentials folder.
mkdir credentials
- Create the
todoist_token
file.
touch credentials/todoist_token
cd credentials/
vi todoist_token
and paste your Todoist API token into todoist_token
.
-
Sign in to your Google account and visit Google Cloud to create a project.
- Click on
CREATE PROJECT
. - Type "todoist-gcal-sync" as Project name and click the
Create
button.
Note: a project todoist-gcal-sync-XXXXX will be created.
-
Select project todoist-gcal-sync-XXXXX from the drop-down.
-
While looking at the project's dashboard, click on the the
Products & services
located at the top left-hand corner of the screen and selectAPIs and Services
. -
Then, click on
ENABLE APIS AND SERVICES
and selectGoogle Calendar API
. -
Then, click on the
ENABLE
button. -
Then, click on
Credentials
followed by theOAuth consent screen
tab. -
Now, type "todoist-gcal-sync" under "Product name shown to users" and click
Save
. -
Click on the
Credentials
tab, followed by theCreate credentials
button and select theOAuth client ID
option. -
Then, select the
Other
option, and type "python" as Application type followed by theCreate
button. -
Then, download the client secret file in JSON format using the download button.
-
Rename the client secret file to
client_secret.json
and place it under the "/credentials" folder.
- Click on
-
Configure the SMTP logging handlder of the log_cfg.json file by replacing
YOUR_GMAIL_USERNAME
andONE_TIME_APP_PASSWORD
with the appropriate information; if you are using Two-Factor Authentication with Gmail, simply create a one-time app password; otherwise, use your existing Gmail password. -
Now edit settings.json according to your needs; if you'd like to exclude some projects or mark others as standalone, then this is the time to make those changes.
Please find attached a sample of my excluded/standalone projects' config.
...
// User Preferences
"projects.excluded": ["Someday | Maybe"],
"projects.standalone": ["Side projects", "todoist_gcal_sync"],
...
-
Run the app for the first time.
Note: Please initialize todoist-gcal-sync with a root user, if you intend to use systemd to run the script as a service.
cd ../src/
python3 daemon.py --noauth_local_webserver
- Copy the link provided to your browser and paste the
verification code
generated to the machine that's running the daemon.
python3 daemon.py
nohup python3 -u ./daemon.py > /dev/null 2>&1&
-
Move and rename the systemd service file.
sudo mv /misc/systemd_service_file /lib/systemd/system/todoist-gcal-sync.service
-
Edit the service file,
sudo vi /lib/systemd/system/todoist-gcal-sync.service
and change
PATH_TO_CLONED_REPO
to the path of the local copy of this repository on your server. -
Refresh systemd.
systemctl daemon-reload
-
Enable the service, so it persists on reboot.
sudo systemctl enable todoist-gcal-sync.service
-
Run the service.
sudo systemctl start todoist-gcal-sync.service
Finally, run the following to confirm the service is up and running:
sudo service todoist-gcal-sync status
Warning: If you experience issues with systemd, use journalctl -u todoist-gcal-sync.service
to investigate further.
touch reset_daemon
python3 daemon.py
Note: This will erase all calendars and the app's database, then re-initialize the app.
- Copy contents of .todoist_sync to the destination system.
- Copy the database to the destination system.
- Run daemon.py.
Please feel free to contribute as the project is still at its infancy. Any help is greatly appreciated.
This project is licensed under the MIT License - see the LICENSE file for details