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:
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
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
- Download LibreOffice extension: https://github.com/prometheus42/libreoffice-ical-importer/releases/tag/v0.2
- Install extension in LibreOffice
- Open LibreOffice Calc
- Click on the tools ("Werkzeuge") menu and start the import function
- Choose iCal file
The fields of the iCal file should be stored as columns in the table.
- META-INF/manifest.xml -> manifest declaring all parts of the extension
- description.xml -> XML file with all information about the extension
- gui.xcu -> XML file for all GUI elements of the extension
- src/import_ical.py -> python code to read iCalendar file and write data into worksheet
- registration/license_*.txt -> license files in various languages
- description/description_*.txt -> info text for extension in various languages
- images/icon.png -> icon for extension
- extensionname.txt -> contains the name of the extension for build script
- build.py -> python script to build .oxt file
- Icon for IcalImporter from GNOME Desktop Tango icon set. Licensed under GNU General Public License version 2.
This extension is released under the MIT License.
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:
- click: Composable command line interface toolkit licensed under the BSD License.
- Ics.py: iCalendar for Humans, licensed under the Apache 2.0 License.
- Arrow: Better dates & times for Python, licensed under the Apache 2.0 License.
- dateutil as dependency of Arrow, licensed under the Apache License and BSD License.
- tatsu as dependency of ics, licensed under a BSD-style License.
- six as dependency of ics, licensed under the MIT License.