Ldaptor is a pure-Python library that implements LDAP client logic, separately-accessible LDAP and BER protocol message generation and parsing, ASCII-format LDAP filter generation and parsing, LDIF format data generation, and Samba password changing logic
Also included is a set of LDAP utilities for use from the command line and a server that can be executed locally.