This repository contains a script that converts ICS calendar files to SQLite databases. It's useful for analyzing and manipulating calendar data, especially when combined with Datasette.
pip install ics-to-datasette
ics-to-datasette calendar.ics
Here's the full help options:
Usage: ics-to-datasette [OPTIONS] ICS_FILES...
Options:
--output [json|sqlite]
--dbname TEXT Name of the SQLite database file
--help Show this message and exit.
Run the script with the following command:
poetry run python run.py <ics_file_paths> --output=json
You can download your calendar data from Google Calendar by going to Google Takeout and selecting the "Calendar" option. You can then extract the downloaded zip file and run the script on the extracted ICS files.
Select tgz
to avoid multiple archives from being created due to file size limits.
You can use the datasette
command to run a Datasette server with the generated SQLite database:
pip install datasette
datasette serve <database_path>
events_with_guests
. Only events that have at least one guest are included in this view. Guests entries like%group.calendar.google.com
are excluded.event_emails_with_count
. This view contains a list of all emails along with the number of events that each email appears in. Helpful for determining your most popular contacts.
Some of the python ical parsing library options I explored:
- add option for additional exclusions