Skip to main content

Merge RFC5545 calendar files

Project description

A simple Python script to merge RFC5545 calendar files. It accepts several input calendars (referred to as sources) and processes them into one or more output calendar (sinks).

Installation

$ pip install merge_ics

Usage

$ merge_ics <config_file>

Config file format

merge_ics reads configuration from YAML files passed through the command line as above. These YAML files should contain two nodes:

  • sources specifies the input calendars, and

  • sinks describes the calendars that should be outputted by the script.

sources

The sources node should contain a mapping whose keys are arbitrary identifiers for the input calendars. The values should again be mappings, with the possible keys being filename and url. The value for filename should describe a local ics file, while that for url should point to a remote one. The presence of both keys will result in merge_ics trying to read and parse the local copy, downloading the remote copy only in case of error.

sinks

The sinks node should contain a collection, each of which is a descriptor for an output calendar. These sink descriptors should contain three keys:

  • filename: the filename where to write the calendar.

  • sources: a mapping with keys being the arbitrary identifiers of the sources that you want to merge. The events from each of these source calendars will be given the corresponding values in a CATEGORIES prop.

  • options: a mapping of calendar-level props. Make sure to always include version and prodid (otherwise the resulting ics file will be non-conformant).

Example

sources:
  1:
    filename: https://example.com/cal_local.ics
  online_cal:
    url: https://example.com/cal_online.ics
  2:
    filename: cal2.ics
    url: https://example.com/cal2.ics
sinks:
  -
    filename: output_cal1.ics
    sources:
      1: Local Events
    options:
      version: 2.0
      prodid: -//Owner//LocalEvents//EN
      x-wr-calname: Local Events
      x-wr-caldesc: Events from my local calendar
      calscale: GREGORIAN
      method: PUBLISH
      x-published-ttl: PT15M
  -
    filename: output_cal123.ics
    sources:
      1: Local Events
      online_cal: Online Events
      2: Another Category
    options:
      version: 2.0
      prodid: -//Owner//Merged//EN
      x-wr-calname: Merged Calendar
      x-wr-caldesc: All my events
      calscale: GREGORIAN
      method: PUBLISH
      x-published-ttl: PT15M

License

MIT

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

merge_ics-0.1.6.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

merge_ics-0.1.6-py2-none-any.whl (6.0 kB view details)

Uploaded Python 2

File details

Details for the file merge_ics-0.1.6.tar.gz.

File metadata

  • Download URL: merge_ics-0.1.6.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for merge_ics-0.1.6.tar.gz
Algorithm Hash digest
SHA256 5d78913dbd55dd5d2ebc2a83151935b48f433fa0268b828d5a0f822347c05fab
MD5 3a21fdfcf74ed8f3abe594559be756f0
BLAKE2b-256 9789aa86f1656b332bce4631e5468c73038673372a3303455cc4e599e43e5d26

See more details on using hashes here.

File details

Details for the file merge_ics-0.1.6-py2-none-any.whl.

File metadata

File hashes

Hashes for merge_ics-0.1.6-py2-none-any.whl
Algorithm Hash digest
SHA256 472363555d525642f119c5a526c24514c685b6103ded0fbf207401a06c11e968
MD5 2cbbf264774a2909d9a879833abd67ad
BLAKE2b-256 1a7e9c48b874347517f94268002a41867f914f18e62be5cd780b47fba5da7c7c

See more details on using hashes here.

Supported by

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