Metadata-Version: 2.1
Name: camerge
Version: 0.0.2
Summary: Merge multiple ical/ics calendars to one.
Home-page: https://github.com/LukasForst/camerge
Author: Lukas Forst
Author-email: lukas@forst.dev
Project-URL: Bug Reports, https://github.com/LukasForst/camerge/issues
Project-URL: Source, https://github.com/LukasForst/camerge
Keywords: calendar calendaring ical icalendar merge calendar-merge anonymization
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7, <4
Description-Content-Type: text/markdown
Provides-Extra: dev
Provides-Extra: test
License-File: LICENSE

# Camerge

A simple library for merging multiple calendars into one.
It also allows anonymization of the events, so nobody will be able to see the summary of the event.

What this solves:
You have multiple calendars, and you want to share availability in `ical` format with some other people.
This tool takes your private calendars (in `ical` format), merges them, optionally anonymize them and creates new `ical`
calendar with the correct availability data.

This project is a minimal library but can be very easily used as an API for example:

```python
import datetime
from fastapi import FastAPI, Response
from camerge import merge_calendars

app = FastAPI()


@app.get("/")
async def calendar():
    """
    This method generates ical data for any calendar app.
    """
    ical = merge_calendars(
        calendar_name='My Availability',
        calendar_domain='my.calendar.example.com',
        calendar_urls=[
            # take this google ical stream and anonymize events (no event names shown)
            ("https://calendar.google.com/calendar/ical/me@me.com/private-x/basic.ics", True),
            # take this event stream and do not anonymize event summary
            ("https://p30-caldav.icloud.com/published/2/xxx", False),
        ],
        # take event availability from these email addresses, these should be your own
        # email addresses associated with the calendar accounts
        known_emails=[
            'me@example.com', 'otherme@example.com'
        ],
        # do not include events that are older than this
        skip_events_before=datetime.date(2021, 1, 1)
    )
    return Response(content=ical, media_type='text/calendar')

```

## Dependencies

This project is based on [icalendar](https://github.com/collective/icalendar).
