Skip to main content

Convert an ICS file to a SQLite database

Project description

ICS to SQLite

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.

Usage

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.

Development

Run the script with the following command:

poetry run python run.py <ics_file_paths> --output=json

Getting Calendar Data From Google Calendar

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.

Datasette

You can use the datasette command to run a Datasette server with the generated SQLite database:

pip install datasette
datasette serve <database_path>

Views

  • 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.

Library Options

Some of the python ical parsing library options I explored:

TODO

  • add option for additional exclusions

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ics_to_datasette-0.3.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

ics_to_datasette-0.3.0-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page