Skip to main content

A Python library to merge iCalendar feeds.

Project description

Python MergeCal

CI Status Documentation Status Test coverage percentage

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

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:

import mergecal
from icalendar import Calendar

# Load your calendars
calendar1 = Calendar.from_ical(open("calendar1.ics", "rb").read())
calendar2 = Calendar.from_ical(open("calendar2.ics", "rb").read())

# Merge the calendars
merger = mergecal.CalendarMerger([calendar1, calendar2])
merged_cal = merger.merge()

# Write the merged calendar to a file
with open("merged_calendar.ics", "wb") as f:
    f.write(merged_cal.to_ical())

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mergecal-0.3.0.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

mergecal-0.3.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file mergecal-0.3.0.tar.gz.

File metadata

  • Download URL: mergecal-0.3.0.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for mergecal-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a16143d411b3097a4c033e36bc318f790b780a1364e472d9138dd790665195fc
MD5 a589b50124db677a590b2d4ed8cd9a3c
BLAKE2b-256 2878f600a56df59fdb7e7caacf2a8119412e5b6f3be43aa07b69b34fef5c4e2a

See more details on using hashes here.

File details

Details for the file mergecal-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mergecal-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for mergecal-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 487951b77f6433c4592aa051cbf119450004b39f8f43737c2cabaa1a6669d13b
MD5 e442b8934955e4a64dde223c933b41b6
BLAKE2b-256 7a1d44c2627057c258860be60196a450d1f89ac9256a75efd37ae0590d68ef0a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page