Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/skyf0l/epitech_to_google_calendar

Synchronize your Epitech calendar with Google.
https://github.com/skyf0l/epitech_to_google_calendar

calendar epitech epitech-intra google-calendar google-calendar-api google-calendar-synchronization sync synchronization

Last synced: 3 months ago
JSON representation

Synchronize your Epitech calendar with Google.

Awesome Lists containing this project

README

        

# EPITECH_to_GOOGLE_calendar

Synchronize your Epitech calendar with Google!

# Features

- [x] Synchronization of epitech calendar on google calendar
- [x] Update modified events / Remove canceled events
- [x] Display location and link of event and mails of teaching assistants in google event description
- [x] Display only the selected slot for multi-slots events
- [x] Project timeline
- [x] Fetch events the events which you supervise (HUB acti for example)
- [x] Fetch registered events from private epitech calendars
- [x] Support multi epitech accounts (great for AERs who have two epitech accounts and calendars)

# Example

This is my google calendar:
- In green: registered events from my epitech calendar
- In light pink: registered project timeline
- In grey: events that I supervise (often HUB activities)
- In red: registered events from my AER epitech calendar

![google calendar](.github/assets/google_calendar.png)

# 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:

```json
[
{
"comment": "student / aer ...",
"epitech_cookie": "...",
"calendarID_events": "[email protected]",
"calendarID_timeline": "[email protected]",
"calendarID_teaching_team": "[email protected]",
"calendarID_other_calendars": "[email protected]"
}
]
```

- `comment` is what you want, it doesn't matter, it's just useful not to get mixed up if you have multiple accounts
- `epitech_cookie` is your user cookie, find it by going on the intra and going into dev console -> application -> cookies -> user
- `calendarID_events` is the calendar in which you want to put all registered events
- `calendarID_timeline` is the calendar in which you want to put projects timeline
- `calendarID_teaching_team` is the calendar in which you want to put events which you supervise (HUB activities for example)
- `calendarID_other_calendars` is the calendar in which you want to put events registered in your private epitech calendars

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!

```json
[
{
"comment": "student",
"epitech_cookie": "...",
"calendarID_events": "[email protected]",
"calendarID_timeline": "[email protected]",
"calendarID_teaching_team": "[email protected]",
"calendarID_other_calendars": "[email protected]"
},
{
"comment": "aer",
"epitech_cookie": "...",
"calendarID_events": "[email protected]",
"calendarID_timeline": "[email protected]",
"calendarID_teaching_team": "[email protected]",
"calendarID_other_calendars": "[email protected]"
}
]
```

## How to get calendarID?

- Create a calendar in google
- Go in your new calendar's settings
- Go in `Integrate Calendar` section
- Copy `Calendar ID` (in general it looks like `[email protected]` or `[email protected]`)

## Google `credentials.json`

To connect your google account with this application, you also need to create an OAuth credentials file ([How generate credentials](Generate_credentials.md)). 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
```