skyf0l / EPITECH_to_GOOGLE_calendar

Synchronize your Epitech calendar with Google.
GNU General Public License v3.0
18 stars 4 forks source link
calendar epitech epitech-intra google-calendar google-calendar-api google-calendar-synchronization sync synchronization

EPITECH_to_GOOGLE_calendar

Synchronize your Epitech calendar with Google!

Features

Example

This is my google calendar:

google calendar

Usage

Fetch all next events

$ python3 main.py

Fetch all events since date

$ python3 main.py YYYY-MM-DD

Config

Python3 - Requirements

$ sudo python3 -m pip install -r requirements.txt

Config file

Create a config.json file (from config-sample.json) with the following content at root of the repo:

[
    {
        "comment": "student / aer ...",
        "epitech_cookie": "...",
        "calendarID_events": "...@group.calendar.google.com",
        "calendarID_timeline": "...@group.calendar.google.com",
        "calendarID_teaching_team": "...@group.calendar.google.com",
        "calendarID_other_calendars": "...@group.calendar.google.com"
    }
]

If you don't want some events you can delete line in config.json or set value to null. If you want to put all events in only one calendarID you can by using the same calendarID.

Multi epitech account or fiend account? So easy!

[
    {
        "comment": "student",
        "epitech_cookie": "...",
        "calendarID_events": "...@group.calendar.google.com",
        "calendarID_timeline": "...@group.calendar.google.com",
        "calendarID_teaching_team": "...@group.calendar.google.com",
        "calendarID_other_calendars": "...@group.calendar.google.com"
    },
    {
        "comment": "aer",
        "epitech_cookie": "...",
        "calendarID_events": "...@group.calendar.google.com",
        "calendarID_timeline": "...@group.calendar.google.com",
        "calendarID_teaching_team": "...@group.calendar.google.com",
        "calendarID_other_calendars": "...@group.calendar.google.com"
    }
]

How to get calendarID?

Google credentials.json

To connect your google account with this application, you also need to create an OAuth credentials file (How generate credentials). Then, rename the downloaded file to credentials.json and put it in the root of the repo.

Automatization

To automatize the synchronization with yours epitech calendars, you can use a cron

For example, to run the program every half hour, you can copy this in your crontab (crontab -e):

*/30 * * * * cd /full/path/EPITECH_to_GOOGLE_calendar/; python3 main.py &>> log