Python LDAP / LDIF

Michael Ströder michael at stroeder.com
Tue Mar 20 00:39:46 CET 2001


Greg Wilson wrote:
> 
> The "ldif.py" file included with your distribution seems
> to translate LDIF to and from Python dicts;

You're on the right track:
l.search() / l.result or l.search_s() returns a list of tuples of DN
and Python dict which you can convert into LDIF with
ldif.CreateLDIF().

> does the main
> library contain a function or functions that I could use
> to push and pull LDIF with the server?

Pulling/pushing directly LDIF wouldn't make much sense since the
LDAP servers are already shipped with tools which do exactly this.

But feel free to dig into http://www.web2ldap.de to see how I'm
doing it.
(Module w2lsearch, w2ladd - not very pretty code though.)

Ciao, Michael.




More information about the python-ldap mailing list