LDAP attribute syntaxes to python data types conversion

Vitaliy Podoba vitaliypodoba at gmail.com
Fri Nov 19 23:14:56 CET 2010


Hi,

LDAP natively supports a lot of different types of syntaxes for it's attributes
in schemas, like syntaxes for strings, booleans, dates, integers, numbers,
etc... But python-ldap queries always return utf-8 encoded strings for any type
of ldap attribute syntax.

So this way in my application to properly handle, for example, boolean ldap
attribute syntax I'm usually doing:

    if ldap_value == 'TRUE':
        value = True
    elif ldap_value == 'FALSE'
        value = False

I'm pretty new to LDAP development so don't know a lot about it's history and
design decisions made during it's development. So I'm just wondering why
python-ldap doesn't benefit from those LDAP attribute syntax definitions and
performs conversion to python data types when possible but always returns
strings.

Was this discussed previously? I can't google any relevant information on this
topic. Any hints, links, suggestions, insights will be highly appreciated!

Regards,
Vitaliy Podoba






More information about the python-ldap mailing list