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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file ics_to_datasette-0.3.0.tar.gz.

File metadata

  • Download URL: ics_to_datasette-0.3.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.4 Linux/6.2.0-1018-azure

File hashes

Hashes for ics_to_datasette-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6a96bcf0f22356f11897471df69582c3e313bbd12fe19e95297908a8adaa6691
MD5 3b68118e02d2aea384456d1fa4027f74
BLAKE2b-256 15cb614767701d0efb27bb7638301f9cda788cd1f8e94383eb46832d81135aa7

See more details on using hashes here.

File details

Details for the file ics_to_datasette-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ics_to_datasette-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.4 Linux/6.2.0-1018-azure

File hashes

Hashes for ics_to_datasette-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42ce2569480bff1baf0812a2fd212298c9bd16d262e8c8128533aea2904c4ae2
MD5 26a3660f88df1a9027087b2939a0ad58
BLAKE2b-256 79ed0958d1fdb9a2f3c43f83d476030b35ba40fe4285399d4f423d42cf8253df

See more details on using hashes here.

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