icalendar.parser_tools module#

icalendar.parser_tools.data_encode(data, encoding='utf-8')[source]#

Encode all datastructures to the given encoding. Currently unicode strings, dicts and lists are supported.

Return type:

Union[bytes, List[bytes], dict]

icalendar.parser_tools.from_unicode(value, encoding='utf-8')[source]#

Converts a value to bytes, even if it already is bytes :type value: Union[str, bytes] :param value: The value to convert :type encoding: :param encoding: The encoding to use in the conversion :rtype: bytes :return: The bytes representation of the value

icalendar.parser_tools.to_unicode(value, encoding='utf-8-sig')[source]#

Converts a value to unicode, even if it is already a unicode string.

Return type:

str