calendar#

Description#

The CalendarPlugin allows you to keep track of multiple calendars (Google or iCal URLs) and get joined events from all of them.

Example:

calendars:
    # Use the Google Calendar integration
    - type: google.calendar

    # Import the Facebook events calendar via iCal URL
    - type: calendar.ical
      url: https://www.facebook.com/ical/u.php?uid=USER_ID&key=FB_KEY

Configuration#

calendar:
  # [Required]
  # List of calendars to be queried. Supported types so far: Google Calendar and iCal URLs.
  calendars:   # type=Collection[dict]

Actions#

Module reference#

class platypush.plugins.calendar.CalendarPlugin(calendars: Collection[dict], *args, **kwargs)[source]#

Bases: Plugin, CalendarInterface

The CalendarPlugin allows you to keep track of multiple calendars (Google or iCal URLs) and get joined events from all of them.

__init__(calendars: Collection[dict], *args, **kwargs)[source]#
Parameters:

calendars – List of calendars to be queried. Supported types so far: Google Calendar and iCal URLs.

Example:

calendars:
    # Use the Google Calendar integration
    - type: google.calendar

    # Import the Facebook events calendar via iCal URL
    - type: calendar.ical
      url: https://www.facebook.com/ical/u.php?uid=USER_ID&key=FB_KEY
get_upcoming_events(max_results=10)[source]#

Get a list of upcoming events merging all the available calendars.

Parameters:

max_results (int) – Maximum number of results to be returned (default: 10)

Returns:

platypush.message.Response – Response object with the list of events in the Google calendar API format.

Example:

output = [
    {
        "id": "123456abcdef",
        "kind": "calendar#event",
        "status": "confirmed",
        "htmlLink": "...",
        "created": "2018-06-01T01:23:45.000Z",
        "updated": "2018-06-01T01:23:45.000Z",
        "creator": {
            "email": "...",
            "displayName": "...",
            "self": true
        },
        "organizer" {
            "email": "...",
            "displayName": "...",
            "self": true
        },
        "start": {
            "dateTime": "2018-06-02T10:00:00.000Z",
        },
        "end": {
            "dateTime": "2018-06-02T12:00:00.000Z",
        },
    },
    ...
]