prometheus42 / libreoffice-ical-importer

Simple extension for LibreOffice for importing iCalendar files (.ics) into LibreOffice Calc.
MIT License
4 stars 3 forks source link
extension icalendar libreoffice libreoffice-calc libreoffice-extension openoffice openoffice-extension python3

Import iCalendar

Simple extension for LibreOffice for importing iCalendar files (.ics) into LibreOffice Calc.

Based on a tutorial by Andreas Mantke and his template

Another nice example can be found here.

As introduction for scripting LibreOffice with Python see these sources:

Building LibreOffice extension

To build a LibreOffice extension use the Makefile that is provided with the project:

make zip

To install the extension in LibreOffice execute the following command:

make install

Building standalone applications

The file src/ical2csv_gui.py and src/ical2csv.py contain a CLI and a GUI application to convert iCalendar files into CSV files.

To create a single EXE file for Windows user, a pyinstaller .spec file has to be created:

pyinstaller --onefile --windowed -i images/icon.ico --add-data C:\Users\christian\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\ics\grammar\contentline.ebnf;ics\grammar\ src\ical2csv_gui.py

Alternativly, you can use the provided spec file in the repo:

pyinstaller ical2csv_gui.spec 

Usage in LibreOffice

  1. Download LibreOffice extension: https://github.com/prometheus42/libreoffice-ical-importer/releases/tag/v0.2
  2. Install extension in LibreOffice
  3. Open LibreOffice Calc
  4. Click on the tools ("Werkzeuge") menu and start the import function
  5. Choose iCal file

The fields of the iCal file should be stored as columns in the table.

File list

Contributions

License

This extension is released under the MIT License.

Requirements

IcalImporter runs under Python 3.6 and newer. Currently (December 2019) LibreOffice seems to ship with Python 3.5.

The following Python packages are necessary: