Skip to main content

Python MergeCal

CI Status Documentation Status Test coverage percentage

uv Ruff pre-commit

PyPI Version Supported Python versions License


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

Copier

This package was created with Copier and the browniebroke/pypackage-template project template.

Metadata

Release files for mergecal 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mergecal 0.6.1
File Size Uploaded Provenance Actions
mergecal-0.6.1.tar.gz 24.6 kB With provenance Details for mergecal-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mergecal 0.6.1
File Interpreter ABI Platform Actions
mergecal-0.6.1-py3-none-any.whl Python 3 none any Details for mergecal-0.6.1-py3-none-any.whl

Total release size: 43.0 kB

Release files / mergecal-0.6.1.tar.gz

Download URL mergecal-0.6.1.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d15a7b8babe5ce019d53406cc14dbf88c8c56695c51220bad70e36146017b779
BLAKE2b-256 checksum
How to use checksums
2fd8b10730f0126a253f388c9e6ea7f3804a8968b83c3d3b6706d30cd8cf3d18
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 log

Release files / mergecal-0.6.1-py3-none-any.whl

Download URL mergecal-0.6.1-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c26903c78233a86d5ba11b851d343da5f7df1c05f432774c704df15d0ed79bfc
BLAKE2b-256 checksum
How to use checksums
77193767604f0899f1f4371b7b3f5cf5c8a29b7bdd8ca7daa1657621f9fab53c
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 log

Security for mergecal 0.6.1

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.

Select from 2 files

Attestation for mergecal-0.6.1.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page