tags:

views:

412

answers:

3

I have to synchronize two different LDAP servers with different schemas. To make my life easier I'm searching for an object mapper for python like SQLobject/SQLAlchemy, but for LDAP. I found the following packages via pypi and google that might provide such functionality:

  • pumpkin 0.1.0-beta1: Pumpkin is LDAP ORM (without R) for python.

  • afpy.ldap 0.3: This module provide an easy way to deal with ldap stuff in python.

  • bda.ldap 1.3.1: LDAP convenience library.

  • Python LDAP Object Mapper: Provides an ORM-like (Django, Storm, SQLAlchemy, et al.) layer for LDAP in Python.

  • ldapdict 1.4: Python package for connecting to LDAP, returning results as dictionary like classes. Results are cached.

Which of these packages could you recommend? Or should I better use something different?

+1  A: 

If I were you I would either use python-ldap or ldaptor. Python-ldap is a wrapper for OpenLDAP so you may have problems with using it on Windows unless you are able to build from source.

LDAPtor, is pure python so you avoid that problem. Also, there is a very well written, and graphical description of ldaptor on the website so you should be able to tell whether or not it will do the job you need, just by reading through this web page:

http://eagain.net/talks/ldaptor/

Michael Dillon
Seems to me the original request is for something more high-level. Something that would be built on top of python-ldap or ldaptor.
ptman
The OP also leaves the door open for suggesting something different. I don't believe that a good ORM exists to do this and since synchronising data is rather low level, even if translating between two schemas, I advised using a good low-level Python interface to LDAP. If the OP knows LDAP well, then python-ldap would work. If not, then LDAPtor would be better since the OP is familiar with Python.
Michael Dillon
A: 

Giving links to the projects in question would help a lot.

Being the developer of Python LDAP Object Mapper, I can tell that it is quite dead at the moment. If you (or anybody else) is up for taking it over, you're welcome :)

Morten Siebuhr
+1  A: 

hi,

little late maybe...

bda.ldap (http://pypi.python.org/pypi/bda.ldap) wraps again python-ldap to a more simple API than python-ldap itself provides.

Further it transparently handles query caching of results due to bda.cache (http://pypi.python.org/pypi/bda.cache).

Additionally it provides a LDAPNode object for building end editing LDAP trees via a dict like API.

It uses some ZTK stuff as well for integration purposes to the zope framework (primary due to zodict package in LDAPNode implementation).

We recently released bda.ldap 1.4.0.

If you take a look at README.txt#TODO, you see whats missing from our POV to declare the lib as final.

Comments are always welcome,

Cheers,

Robert

rnix