Converting Google Calendar Links to iCal

Recently I stumbled upon a Google support thread that outlines how to convert a Google calendar link into an iCal subscription link. The reason this is so important is that it allows you to subscribe to a Google calendar via any other sort of caldav client including Nextcloud or the iOS/macOS’ native Calendar app. As an example, let’s take the Jupiter Broadcasting calendar and convert it into an iCal link to subscribe to via Nextcloud. Here’s the link: Notice the src= portion of it? We’re going to copy the part directly after that, so in this case it’s

We’re going to take this section, and wrap it with this:<src>/public/basic.ics, where <src> is the part from the previous section. The final result ends up looking like this: If you copy that into your Nextcloud calendar subscriptions, you’ll now have access to the Jupiter Broadcasting calendar without having to use Google yourself. #degoogled

To simplify this process, I’ve written a quick Python script to do this for you. Here’s the source for it:

#!/usr/bin/env python3

from urllib.parse import urlparse,parse_qsl
import sys
from pprint import pprint

ICAL_FORMAT = '{}/public/basic.ics'

def main(cli_input):
    gcal_url = o = urlparse(cli_input)
    query_string = gcal_url.query
    src = parse_qsl(query_string)
    for pair in parse_qsl(query_string):
        if pair[0] == 'src':

if __name__ == '__main__':

Copy that into a file, like, give it executable permissions, then run it like so:


That will produce our ical URL,, which we can directly paste into Nextcloud or any other caldav client which supports ical calendar subscriptions.

I’ve also added this script to a git repo, so be sure to check there in case the source has updated.