icalendar.caselessdict module#
- class icalendar.caselessdict.CaselessDict(*args, **kwargs)[source]#
Bases:
OrderedDictA dictionary that isn't case sensitive, and only uses strings as keys. Values retain their case.
Set keys to upper for initial dict.
- canonical_order = None#
- clear()#
Remove all items from ordered dict.
- classmethod fromkeys(iterable, value=None)#
Create a new ordered dictionary with keys from iterable and values set to value.
- get(key, default=None)[source]#
Return the value for key if key is in the dictionary, else default.
- Return type:
- items()#
Return a set-like object providing a view on the dict's items.
- keys()#
Return a set-like object providing a view on the dict's keys.
- move_to_end(key, last=True)#
Move an existing element to the end (or beginning if last is false).
Raise KeyError if the element does not exist.
- pop(key, default=None)[source]#
If the key is not found, return the default if given; otherwise, raise a KeyError.
- Return type:
- 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.
- Return type:
- 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(*args, **kwargs)[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]
- Return type:
- values()#
Return an object providing a view on the dict's values.