Python-ldap provides an API to access LDAP directory servers
Most major programming languages have LDAP API (Lightweight directory access protocol) but Python’s is perhaps the easiest.
Writing programs that access LDAP servers is easy to do using Python and python-ldap. The python-ldap package contains a module that wraps the OpenLDAP C API and provides an object-oriented client API to interact with LDAP directory servers. The package also contains modules to do other tasks related to LDAP, such as processing LDIF, LDAPURLs and LDAPv3 schemes and more.