Installation
python-ldap
installation is very simple. On CentOS 7, you just need to
# install openldap-devel
yum install openldap-devel
# then install python-ldap via pip
pip install python-ldap
Usage
To use it, you can refer to the third-party get started docs on it’s website
There are some tricky points when looking at its API doc.
For example, you can see there is a ldap.filter
module. Based on my understanding, the first time I tried to import the module in the following manner.
>>> import ldap
>>> ldap.filter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'filter'
It seems that there is no filter
module in ldap
. But the doc says it’s there. Then I tried this.
import ldap.filter
help(ldap.filter)
This time, it works.