This project integrates Google Calendar events and ICS files with Google Tasks.
It allows you to automatically create tasks from calendar events, while also filtering them with keywords.
-
Enable Google APIs
- Go to Google Cloud Console.
- Create a project and enable the Google Calendar API and Google Tasks API.
- Configure OAuth 2.0 credentials (desktop app).
- Download the
credentials.json
file and place it in the projectβs root directory.
-
Install dependencies
pip install -r requirements.txt
-
First Run
- On the first execution, a browser will open to authenticate your Google account.
- A
token.json
file will be created and reused for future logins.
The project uses two keyword arrays to control event β task conversion:
-
TASK_KEYWORDS
- Add words that, if present in the eventβs title/summary, will create a Google Task.
- Example:
TASK_KEYWORDS = ["exam", "meeting", "assignment"]
-
IGNORE_KEYWORDS
- Add words that, if present in the eventβs title/summary, will be ignored completely.
- Example:
IGNORE_KEYWORDS = ["holiday", "birthday"]
If an event matches both TASK_KEYWORDS
and IGNORE_KEYWORDS
, it will be ignored.
Run the main script:
python cal.py
You can also run with an .ics
file:
python cal.py my_calendar.ics
- Reads events from Google Calendar and/or ICS file.
- Creates tasks in Google Tasks based on your keyword rules.
- Skips tasks containing ignore keywords.
- Can clear all tasks in a specific task list before syncing (optional).
- Make sure your system time and timezone are correct to avoid syncing issues.
- If you want to use a different Google Tasks list, update the
TASKS_LIST_ID
in the code. - You want to connect with moodle? Then access moodle and click on calendar, find export calendar and copy the URL, then add to URL ;-)