Advanced usage

This page will present some more advanced usage of as well as some parts of the low level API.

Custom properties does not indeed support the full rfc5545 specification and most likely, it will never do as it is too much work. Also, there are as many extensions to the RFC as there are implementations of iCalendar creators so it would be impossible to support every existing property.

The way around this limitation is that every ics.parse.Container (Event, Todo and even Calendar inherit from Container) has a .extra attribute.

At parsing time, every property or container that is unknown to (and thus not handled) is stored in .extra. The other way, everything in .extra is serialized when outputting data.

Let’s say that we have an input like this (indentation is for illustration purposes):

  SUMMARY:Name of the event

It will result in an event that will have the following characteristics: == "Name of the event"
e.extra == [ContentLine(name="FOO", value="BAR")]

In a more complicated situation, you might even have something like this:

  SUMMARY:Name of the event

It will result in an event that will have a ics.parse.Container in .extra: == "Name of the event"
e.extra == [
        ContentLine(name="BAR", value="MISC")
    ContentLine(name="THX", value="BYE")

.extra is mutable so this means it works in reverse too.

Just add some Container or ics.parse.ContentLine and they will appear in the output too. (You can even mutate the values of a specific ContentLine if you desire)

Low level API