Skip to main content

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

Metadata

Release files for ics-to-datasette 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ics-to-datasette 0.3.0
File Size Uploaded Provenance
ics_to_datasette-0.3.0.tar.gz 2.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ics-to-datasette 0.3.0
File Interpreter ABI Platform
ics_to_datasette-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / ics_to_datasette-0.3.0.tar.gz

Download URL ics_to_datasette-0.3.0.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6a96bcf0f22356f11897471df69582c3e313bbd12fe19e95297908a8adaa6691
BLAKE2b-256 checksum
How to use checksums
15cb614767701d0efb27bb7638301f9cda788cd1f8e94383eb46832d81135aa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.4 Linux/6.2.0-1018-azure

Release files / ics_to_datasette-0.3.0-py3-none-any.whl

Download URL ics_to_datasette-0.3.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42ce2569480bff1baf0812a2fd212298c9bd16d262e8c8128533aea2904c4ae2
BLAKE2b-256 checksum
How to use checksums
79ed0958d1fdb9a2f3c43f83d476030b35ba40fe4285399d4f423d42cf8253df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.4 Linux/6.2.0-1018-azure

Security for ics-to-datasette 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page