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.1.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

mergecal-0.3.1-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mergecal-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f0c446765c3310ffacfc5cb408e25d18fc55c97ddf2b392a34aa66aaf154dcff
MD5 861be373557a5c006acecada6cc24e91
BLAKE2b-256 56a7e712fd77cb99ac099b7617be370ba21218ece4d6e463f0a368449b293836

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mergecal-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6e0a80d3e7882598f5458c0889a955f135e97f50a8aba364af3dc509e49d16e
MD5 8708f2ea56551bfd846d3949df1a4fca
BLAKE2b-256 3c3bb648d51f841eabd545260a6cd85563a56c7008db890b4819326fa4f6c6c4

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