Skip to main content

Merge multiple ical/ics calendars to one.

Project description

Camerge

PyPi version PyPI license PyPI pyversions

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:

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_data=[
            # 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.

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

camerge-0.0.3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

camerge-0.0.3-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file camerge-0.0.3.tar.gz.

File metadata

  • Download URL: camerge-0.0.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for camerge-0.0.3.tar.gz
Algorithm Hash digest
SHA256 008b723f6b1d1dad848b7ea756ca787bafd74187ca52086dd704b2318b61a3fa
MD5 48a34c7f5f68ba35b32bb0ccee5c215b
BLAKE2b-256 aa72ad3e053ce60592337cdf36791fcadbaae2d7686120cc211925b59900d740

See more details on using hashes here.

File details

Details for the file camerge-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: camerge-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for camerge-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0b8e8b70ff0d752a6a004fc02f8c7ccf7492cd0fdd9250b9808ff3707ac52dd5
MD5 1a09f582e77e2dc6ecd4a586cd1be6c3
BLAKE2b-256 2b167d209946955802a4e25e05f85d99ce9ffd8ab304a16f2cefd8f7021e37ed

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