that's what encode() should be doing after it gets passed an some encodable values.
eg. for the calendar, the basic information needed should be fairly minimal (timestamps for the ranges, timezone, language. all other values should be calculated from those)
greetings, martin.