icalendar.caselessdict module#

class icalendar.caselessdict.CaselessDict(*args, **kwargs)[source]#

Bases: OrderedDict

A dictionary that isn’t case sensitive, and only uses strings as keys. Values retain their case.

canonical_order = None#
copy() a shallow copy of od[source]#
get(key, default=None)[source]#

Return the value for key if key is in the dictionary, else default.

has_key(key)[source]#
pop(key[, default]) v, remove specified key and return the corresponding value.[source]#

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()[source]#

Remove and return a (key, value) pair from the dictionary.

Pairs are returned in LIFO order if last is true or FIFO order if false.

setdefault(key, value=None)[source]#

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

sorted_items()[source]#

Sorts items according to the canonical_order for the derived class. Items not specified in canonical_order will appear at the end.

sorted_keys()[source]#

Sorts keys according to the canonical_order for the derived class. Keys not specified in canonical_order will appear at the end.

update([E, ]**F) None.  Update D from mapping/iterable E and F.[source]#

If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

icalendar.caselessdict.canonsort_items(dict1, canonical_order=None)[source]#

Returns a list of items from dict1, sorted by canonical_order.

icalendar.caselessdict.canonsort_keys(keys, canonical_order=None)[source]#

Sorts leading keys according to canonical_order. Keys not specified in canonical_order will appear alphabetically at the end.