gromex
is a Python module for exporting data from Grommunio. It can be used either directly as a Python library or as a command-line utility to export calendar data.
- Library: Programmatically connect to a Grommunio CalDAV server and export calendar data using the
GrommunioCalendars
class. - Command-line Utility: Easily export calendar data from the terminal with the
gromex
command.
This is an early version, and new features will be added based on user requests and feedback. Feel free to suggest improvements or additional functionality!
-
Clone the repository:
git clone https://github.com/rohzb/gromex.git cd gromex
-
Set up the Python environment and install dependencies:
./scripts/bootstrap.sh
For more detailed examples, refer to example.ipynb.
Running the following example will create .ics
files for all found calendars:
from gromex import GrommunioCalendars
# Step 1: Create an instance of GrommunioCalendars
grommunio = GrommunioCalendars(username="[email protected]", autoconnect=False)
# Step 2: Manually connect to the Grommunio CalDAV server
grommunio.connect()
# Step 3: Export calendars to the 'local/cals/' directory
grommunio.export(path='local/cals/')
-
autoconnect=True
(default): Automatically connects to the CalDAV server when creating the instance.grommunio = GrommunioCalendars(username="[email protected]") # Automatically connects
-
autoconnect=False
: Requires manually calling theconnect()
method to establish a connection.grommunio = GrommunioCalendars(username="[email protected]", autoconnect=False) grommunio.connect() # Manually connects
-
Using a Custom Server: To connect to a different CalDAV server, pass the
url
parameter to the constructor. The default server ishttps://hope.helmholtz-berlin.de
, but you can override it like this:grommunio = GrommunioCalendars(username="[email protected]", url="https://custom-server.com")
This will connect to the specified server instead of the default.
-
Pass Password Directly: Provide the password directly when creating the instance (avoid hardcoding sensitive data).
grommunio = GrommunioCalendars(username="[email protected]", password="yourpassword")
-
Prompt for Password: If no password is provided, the system will prompt you to securely input it.
grommunio = GrommunioCalendars(username="[email protected]")
Use the show_summary()
method to display a summary of available calendars, including names, supported components (VEVENT, VTODO), and event/task counts.
grommunio.show_summary() # Displays the summary of available calendars
The export()
method exports calendar data to a specified directory.
save_single_events
(default:False
): IfTrue
, each event is saved as an individual.ics
file.save_combined_calendar
(default:True
): IfTrue
, a combined.ics
file is saved for the entire calendar.
-
Export only combined calendars (default):
grommunio.export(path='local/cals/')
-
Export both individual events and combined calendars:
grommunio.export(path='local/cals/', save_single_events=True, save_combined_calendar=True)
The gromex
command-line utility allows you to export calendar data directly from the terminal.
gromex [username] [destination] [--server SERVER_URL] [--password PASSWORD] [--save-separate]
-
Using the default Grommunio server:
gromex [email protected] /path/to/export --save-separate
-
Specifying a custom server:
gromex [email protected] /path/to/export --server https://example.com --save-separate
username
: Grommunio account username (e.g.,[email protected]
).destination
: Directory to save the exported.ics
files.--server
: Optional. Specify the CalDAV server URL (default:https://hope.helmholtz-berlin.de
).--password
: Optional. Provide the password for the Grommunio account. If not provided, it will prompt for input.--save-separate
: Optional. If included, saves each event as a separate.ics
file.
- Recurring Events Import:
- Importing
.ics
files into Exchange has issues with recurring events - they do not show up. That problem is under investigation now...
- Importing
This project is licensed under the MIT License. See the LICENSE file for details.