Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/shanto268/markdown2calendar

Automatically creating Google Calendar Events from time sensitive items on my to do lists (.md files)
https://github.com/shanto268/markdown2calendar

google-calendar llama3 machine-learning neovim ollama productivity to-do-app to-do-list zettelkasten

Last synced: about 16 hours ago
JSON representation

Automatically creating Google Calendar Events from time sensitive items on my to do lists (.md files)

Awesome Lists containing this project

README

        

# Time Sensitive Events from Markdown To Do Lists to Google Calendar Events

I use the neovim plugins - [zettlekasten.nvim](https://github.com/Furkanzmc/zettelkasten.nvim), [nvim-telekasten.nvim](https://github.com/nvim-telekasten/telekasten.nvim) (with my custom config) - to make daily to-do lists (in `markdown` format). I wanted to use my local llama3 model to extract time-sensitive action items from my daily to-do lists and create Google Calendar events for them. This project automates that process. It runs as a background service on macOS, using `launchd` to schedule daily execution at 12:10 AM PDT.

## Features

- **Markdown Parsing**: Reads daily tasks from markdown files.
- **Action Item Extraction**: Uses a local LLM (e.g., Ollama) to extract time-sensitive action items.
- **Google Calendar Integration**: Creates events in Google Calendar based on extracted action items.
- **Scheduled Execution**: Runs as a `launchd` service on macOS, executing the script daily at 12:10 AM PDT.

## Requirements

- Python 3.x
- `google-auth`, `google-api-python-client`
- `dotenv`
- `langchain-community`
- A Google Cloud project with the Calendar API enabled and a service account with appropriate permissions.

## Setup

### 1. Clone the Repository

```sh
git clone https://github.com/shanto268/zettelkasten2calendar.git
cd zettelkasten2calendar
```

### 2. Install Dependencies

```sh
pip install -r requirements.txt
```

### 3. Configure Google Calendar API

- Create a Google Cloud project and enable the Calendar API.
- Create a service account and download the JSON credentials file.
- Share your calendar with the service account email.

### 4. Create `.secrets` File

Create a `.secrets` file in the project root directory with the following content:

```dotenv
[email protected]
GOOGLE_CREDENTIALS_PATH=/path/to/your/credentials.json
```

### 5. Configure `launchd`

Create a plist file for `launchd` to schedule the Python script. Save it as `com.yourusername.zettelkasten_to_calendar.plist` in `~/Library/LaunchAgents/`.

```xml


Label
com.yourusername.zettelkasten_to_calendar
ProgramArguments

/usr/local/bin/python3
/path/to/zettelkasten_to_calendar.py

StartCalendarInterval

Hour
00
Minute
10

StandardOutPath
/tmp/zettelkasten_to_calendar.log
StandardErrorPath
/tmp/zettelkasten_to_calendar.err
RunAtLoad

```

Load the plist file into `launchd`:

```sh
launchctl load ~/Library/LaunchAgents/com.yourusername.zettelkasten_to_calendar.plist
```

### 6. Verify the Job

Ensure the job is scheduled:

```sh
launchctl list | grep com.yourusername.zettelkasten_to_calendar
```

## Usage

### Running the Script

The script will automatically run every day at 12:10 AM PDT, check for that day's markdown file, and create events in Google Calendar based on the extracted action items.

### Manual Execution

You can also run the script manually:

```sh
python main.py
```

## Troubleshooting

- Ensure the paths in your plist file are correct.
- Check `/tmp/zettelkasten_to_calendar.log` and `/tmp/zettelkasten_to_calendar.err` for logs and errors.

## License

This project is licensed under the MIT License.