ldap3.utils.conv module

ldap3.utils.conv.check_json_dict(json_dict)
ldap3.utils.conv.escape_bytes(bytes_value)

Convert a byte sequence to a properly escaped for LDAP (format BACKSLASH HEX HEX) string

ldap3.utils.conv.escape_filter_chars(text, encoding=None)

Escape chars mentioned in RFC4515.

ldap3.utils.conv.format_json(obj)
ldap3.utils.conv.is_filter_escaped(text)
ldap3.utils.conv.json_encode_b64(obj)
ldap3.utils.conv.json_hook(obj)
ldap3.utils.conv.prepare_for_stream(value)
ldap3.utils.conv.to_raw(obj, encoding='utf-8')

Tries to convert to raw bytes from unicode

ldap3.utils.conv.to_unicode(obj, encoding=None, from_server=False)

Try to convert bytes (and str in python2) to unicode. Return object unmodified if python3 string, else raise an exception