Skip to content

bunburya/eml2cal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eml2cal

eml2cal is a Python script that wraps kitinerary-extractor, which is a command line tool that uses the KDE KItinerary library to extract data about events and reservations from emails, PDFs and other documents. kitinerary-extractor is capable of converting many types of email to calendar events, but eml2cal adds features such as:

  • mailbox integration: Point the script to a mailbox in the Maildir or mbox format to have it process all emails in that mailbox.
  • pre-processing: Perform actions on emails before they are fed to kitinerary-extractor, such as altering the headers.
  • iCalendar generation: Create iCalendar events from emails, with more information and more fine-grained control than kitinerary-extractor's own iCalendar output feature.
  • CalDAV integration: Add created iCalendar events directly to a CalDAV calendar.
  • reporting: Send a report summarising the actions that have been taken, for monitoring purposes.

I developed it for my own personal needs and it hasn't been extensively tested, but hopefully others find it useful.

Dependencies

eml2cal is written in Python. The Python dependencies are listed in the Pipfile and other than that, the main dependency is kitinerary-extractor, which can be installed via flatpak as follows:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists kitinerary-extractor-nightly --from https://cdn.kde.org/flatpak/kitinerary-extractor-nightly/kitinerary-extractor-nightly.flatpakrepo
flatpak install kitinerary-extractor-nightly org.kde.kitinerary-extractor

Configuration

eml2cal is configured via a TOML file. A valid configuration file must be available: configuration using command-line options is not currently supported. A commented example TOML file is provided in the repo. You can point eml2cal to your config file with the --config option; otherwise, it will search for config.toml in your standard user config directory as determined by the platformdirs library (on Linux, probably $HOME/.config/eml2cal/).

A documented example config.toml file is provided.

Usage

git clone https://github.com/bunburya/eml2cal.git
cd eml2cal
pip install .
eml2cal --config my_config.toml

About

Scripts for creating iCalendar files from emails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages