An open API service indexing awesome lists of open source software.

https://github.com/skn0tt/icbu-to-sqlite

Analyze your Apple Calendar with SQL!
https://github.com/skn0tt/icbu-to-sqlite

calendar productivity sql

Last synced: 5 months ago
JSON representation

Analyze your Apple Calendar with SQL!

Awesome Lists containing this project

README

          

# icbu-to-sqlite

> Run full SQL queries on your calendar!

This repo contains a small script to pipe your Apple Calendar data into an SQLite database.

## Usage

1. Clone this repository.

```bash
git clone https://github.com/skn0tt/icbu-to-sqlite /some-dir
```

2. Export your calendar archive into `/some-dir/cal.icbu`.

![](./step-1.png)

![](./step-2.png)

3. Run `npm i` && `node index.js`.

4. Run your queries on `db.sqlite`!

![](./step-3.png)

Full Query

```sql
SELECT
SUM((strftime('%s', dtend) - strftime('%s', dtstart)) / 3600) as duration,
calendar.title as calendar
FROM event
JOIN calendar ON calendar.id = calendarId
WHERE event.transp <> 'TRANSPARENT'
AND dtstart BETWEEN {{start}} AND {{end}}
GROUP BY calendarId
```