A Python library to merge iCalendar feeds.
Project description
Python MergeCal
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mergecal-0.2.0.tar.gz
.
File metadata
- Download URL: mergecal-0.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6eefdd4a006e47c5aa1a859493baac1d3cbbd1a4a4b1eaef9c18a5de36f683a0 |
|
MD5 | 0748069b277485159a6109c3e77b09d1 |
|
BLAKE2b-256 | d434c0e5aae9220809e5b3636a39a1d417893e8d382a9a1752abcbfe30d91585 |
File details
Details for the file mergecal-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: mergecal-0.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | bab99a6c5c95a6a46db2e8451b17412378b9c8bebbb9ca891c8cfa35d17287e2 |
|
MD5 | 40523a3e40885efc0868910f86958535 |
|
BLAKE2b-256 | dd167d5efca08e15e16100bd64d428d1bee027d124380d250f1e20e39fc68a71 |