Python MergeCal
Documentation: https://mergecal.readthedocs.io
Source Code: https://github.com/mergecal/python-mergecal
A Python library to merge iCalendar feeds.
Merging two calendars might look easy but it is not! Here is a list of features:
- ✅ Google Calendar Compatibility (X-WR-TIMEZONE)
- ✅ Add Timezones in the right place
- ✅ handle duplicated events
- ✅ handle modifications (deletion, addition) of events
Installation
Install this via pip (or your favorite package manager):
pip install mergecal
Usage
Python API
You can use MergeCal in your Python code as follows:
>>> from mergecal import merge_calendars
>>> from icalendar import Calendar
# Load your calendars
# CALENDARS = pathlib.Path("to/your/calendar/directory")
>>> calendar1 = Calendar.from_ical((CALENDARS / "one_event.ics").read_bytes())
>>> calendar2 = Calendar.from_ical((CALENDARS / "another_event.ics").read_bytes())
# Merge the calendars
>>> merged_calendar : Calendar = merge_calendars([calendar1, calendar2])
# Write the merged calendar to a file
>>> (CALENDARS / "merged_calendar.ics").write_bytes(merged_calendar.to_ical())
998
# The merged calendar will contain all the events of both calendars
>>> [str(event["SUMMARY"]) for event in calendar1.walk("VEVENT")]
['Event 1']
>>> [str(event["SUMMARY"]) for event in calendar2.walk("VEVENT")]
['Event 2']
>>> [str(event["SUMMARY"]) for event in merged_calendar.walk("VEVENT")]
['Event 1', 'Event 2']
Command Line Interface (CLI)
MergeCal also provides a command-line interface for easy merging of calendar files:
# Basic usage
mergecal calendar1.ics calendar2.ics -o merged_calendar.ics
# Specifying custom PRODID
mergecal calendar1.ics calendar2.ics -o merged_calendar.ics --prodid "-//My Organization//MergeCal 1.0//EN"
For more options and information, use the help command:
mergecal --help
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Credits
This package was created with Copier and the browniebroke/pypackage-template project template.
Metadata
Release files for mergecal 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mergecal-0.6.0.tar.gz | 24.6 kB | With provenance | Details for mergecal-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mergecal-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for mergecal-0.6.0-py3-none-any.whl |
Total release size: 43.0 kB
Release files / mergecal-0.6.0.tar.gz
| Download URL | mergecal-0.6.0.tar.gz |
|---|---|
| Size | 24.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30eb3e30d12706843a6324c7ca4568fd2416735190cfb2e96a4da25ea4989f5d
|
|
BLAKE2b-256 checksum How to use checksums |
0140123bf6c6909f1ec288c9f78d4916077021c4449b294f50e67d07daf1cedc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / mergecal-0.6.0-py3-none-any.whl
| Download URL | mergecal-0.6.0-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
538a3d45d008e8209db526caccc4e5043696914b3349bf407867008923637d69
|
|
BLAKE2b-256 checksum How to use checksums |
14c612ad95b89bade2a06620693051a561ddbc79555bea17bc6d40f1a9d82d55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logSecurity for mergecal 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mergecal-0.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.