Filter and merge events from multiple iCalendar feeds
Find a file
2020-11-01 21:57:49 +01:00
app Improve caching method: using sched.scheduler 2020-11-01 21:57:49 +01:00
.gitignore Implement caching of calendar files 2020-10-24 23:42:12 +02:00
config-sample.txt First version 2020-09-25 22:26:02 +02:00
LICENSE Initial commit 2020-09-21 14:01:58 +02:00
README.md Fixing typo 2020-09-29 19:28:18 +02:00
requirements.txt Implement caching of calendar files 2020-10-24 23:42:12 +02:00

ICS Fusion

Introduction

ICS Fusion is a tool to merge multiple ics feed into a single ics calendar. Filters and modifications may be applied on the incoming feeds. The resulting ics can be accessed via an HTTP endpoint.

Installation

ICS Fusion is written in Python and using Flask to provide the HTTP endpoint. Make sure to install all the modules listed in the requirements.txt file before launching the tool.

Launch the app/server.py file to start the application.

Configuration

To create a new feed in the application, create a file with the .json extension in the app/config folder. The name of the configuration file will be used to create a new endpoint to serve the feed.

The JSON configuration file should look like the following.

[
    {
        "url":"str",
        "name":"str",
        "encoding":"str",
        "filters":{
            "name":{
                "exclude":"RegEx",
                "includeOnly":"RegEx",
                "ignoreCase":true
            },
            "description":{
                "exclude":"RegEx",
                "includeOnly":"RegEx",
                "ignoreCase":true
            }
        },
        "modify":{
            "time":{
                "shift":{
                    "year":0,
                    "month":0,
                    "day":0,
                    "hour":0,
                    "minute":0
                }
            },
            "name":{
                "addPrefix":"str",
                "addSuffix":"str"
            },
            "description":{
                "addPrefix":"str",
                "addSuffix":"str"
            },
            "location":{
                "addPrefix":"str",
                "addSuffix":"str"
            }
        }
    }
]

Only the url and the name field are mandatory.

  • url: specify the url to find the calendar

  • name: name to identify the calendar

  • encoding: specify the encoding to use

  • filters: structure defining the filters to apply to the calendar

  • name: filters to apply to the name field of the events

  • description: filters to apply to the name field of the events

  • exclude: RegEx to describe the events to exclude - cannot be specified with includeOnly

  • includeOnly: RegEx to describe the events to include - cannot be specified with exclude

  • ignoreCase: if true the RegEx will ignore the case of the field

  • modify: structure defining the modifications to the events of the calendar

  • time: describe the modifications to apply to the timing of the event

  • shift: shift the event of a certain amount of time

  • year, month, day, hour, minute: amount of time to add to the events

  • name: modifications to apply to the name of the events

  • description: modifications to apply to the description of the events

  • location: modification to apply to the location of the events

  • addPrefix: string to add at the beginning of the field

  • addSuffix: string to add at the end of the field

If multiple calendars are specified in the configuration list, their events will be merged in the resulting ics feed.

Usage

Once the config file is created, the corresponding HTTP endpoint is accessible. For example, if the file app/config/my-calendar.json contains the configuration, the HTTP endpoint will be http://localhost:8088/my-calendar.

Limitations

Currently, the application only merges events of the ics feeds, the alarms and todos are not supported. There is no mechanism to handle the case where an incoming feed becomes unavailable.