ldap3 2.9.1


pip install ldap3

  Latest version

Released: Jul 18, 2021

Project Links

Meta
Author: Giovanni Cannata

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers
  • System Administrators

Operating System
  • MacOS :: MacOS X
  • Microsoft :: Windows
  • POSIX :: Linux

License
  • OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)

Programming Language
  • Python
  • Python :: 2
  • Python :: 3

Topic
  • Software Development :: Libraries :: Python Modules
  • System :: Systems Administration :: Authentication/Directory :: LDAP
Latest Version License TRAVIS-CI build status for master branch

ldap3 is a strictly RFC 4510 conforming LDAP V3 pure Python client library. The same codebase runs in Python 2, Python 3, PyPy and PyPy3.

A more pythonic LDAP

LDAP operations look clumsy and hard-to-use because they reflect the old-age idea that time-consuming operations should be performed client-side to not hog the server with heavy elaborations. To alleviate this ldap3 includes a fully functional Abstraction Layer that lets you interact with the LDAP server in a modern and pythonic way. With the Abstraction Layer you don’t need to directly issue any LDAP operation at all.

Thread safe strategies

In multithreaded programs you must use on of SAFE_SYNC (synchronous connection strategy), SAFE_RESTARTABLE (restartable syncronous connection strategy) or ASYNC (asynchronous connection strategy).

Each LDAP operation with SAFE_SYNC or SAFE_RESTARTABLE strategies returns a tuple of four elements: status, result, response and request.

  • status: states if the operation was successful

  • result: the LDAP result of the operation

  • response: the response of a LDAP Search Operation

  • request: the original request of the operation

The SafeSync strategy can be used with the Abstract Layer, but the Abstract Layer currently is NOT thread safe. For example, to use SAFE_SYNC:

from ldap3 import Server, Connection, SAFE_SYNC
server = Server('my_server')
conn = Connection(server, 'my_user', 'my_password', client_strategy=SAFE_SYNC, auto_bind=True)
status, result, response, _ = conn.search('o=test', '(objectclass=*)')  # usually you don't need the original request (4th element of the returned tuple)

With ASYNC you must request the response with the get_response() method.

Home Page

The home page of the ldap3 project is https://github.com/cannatag/ldap3

Documentation

Documentation is available at http://ldap3.readthedocs.io

License

The ldap3 project is open source software released under the LGPL v3 license. Copyright 2013 - 2020 Giovanni Cannata

PEP8 Compliance

ldap3 is PEP8 compliant, except for line length.

Download

Package download is available at https://pypi.python.org/pypi/ldap3.

Install

Install with pip install ldap3

Git repository

You can download the latest source at https://github.com/cannatag/ldap3

Continuous integration

Continuous integration for testing is at https://travis-ci.org/cannatag/ldap3

Support & Development

You can submit support tickets on https://github.com/cannatag/ldap3/issues/new You can submit pull request on the dev branch at https://github.com/cannatag/ldap3/tree/dev

Thanks to

  • Ilya Etingof, the author of the pyasn1 package for his excellent work and support.

  • Mark Lutz for his Learning Python and Programming Python excellent books series and John Goerzen and Brandon Rhodes for their book Foundations of Python Network Programming. These books are wonderful tools for learning Python and this project owes a lot to them.

  • JetBrains for donating to this project the Open Source license of PyCharm Professional.

  • GitHub for providing the free source repository space and the tools I use to develop this project.

  • The FreeIPA team for letting me use their demo LDAP server in the ldap3 tutorial.

Contact me

For information and suggestions you can contact me at cannatag@gmail.com. You can also open a support ticket on https://github.com/cannatag/ldap3/issues/new

Changelog

Updated changelog at https://ldap3.readthedocs.io/changelog.html

2.10.2rc3 Nov 09, 2025
2.10.2rc2 Apr 19, 2025
2.9.1 Jul 18, 2021
2.9 Jan 24, 2021
2.8.1 Sep 07, 2020
2.8 Aug 08, 2020
2.7 Mar 01, 2020
2.6.1 Sep 06, 2019
2.6 Mar 24, 2019
2.5.2 Dec 28, 2018
2.5.1 Aug 01, 2018
2.5 Apr 14, 2018
2.4.1 Jan 21, 2018
2.4 Nov 14, 2017
2.3 Aug 02, 2017
2.2.4 May 07, 2017
2.2.3 Apr 30, 2017
2.2.2 Mar 17, 2017
2.2.1 Feb 12, 2017
2.2.0 Jan 16, 2017
2.1.1 Nov 18, 2016
2.1.0 Nov 03, 2016
2.0.9 Oct 28, 2016
1.4.0 Jul 18, 2016
1.3.3 Jul 03, 2016
1.3.1 May 11, 2016
1.2.2 Mar 23, 2016
1.2.1 Mar 21, 2016
1.1.2 Mar 09, 2016
1.0.4 Jan 25, 2016
1.0.3 Dec 19, 2015
1.0.2 Dec 07, 2015
0.9.8.7.post1 Sep 06, 2016
2.7.win Mar 01, 2020
2.6.win Mar 24, 2019
2.6.1.win Sep 06, 2019
2.5.win Apr 14, 2018
2.5.2.win Dec 28, 2018
2.5.1.win Aug 01, 2018
2.4.win Nov 14, 2017
2.4.1.win Jan 21, 2018
2.3.win Aug 02, 2017
2.2.4.win May 07, 2017
2.2.3.win Apr 30, 2017
2.2.2.win Mar 17, 2017
2.2.1.win Feb 12, 2017
2.2.0.win Jan 16, 2017
2.1.1.win Nov 18, 2016
2.1.0.win Nov 03, 2016
2.0.9.win Oct 28, 2016
1.4.0.win Jul 18, 2016
1.3.3.win Jul 03, 2016
1.3.1.win May 11, 2016
1.2.2.win Mar 23, 2016
1.2.1.win Mar 21, 2016
1.1.2.win Mar 09, 2016
1.0.4.win Jan 25, 2016
1.0.3.win Dec 19, 2015
1.0.2.win Dec 07, 2015
0.9.8.7.post1.win Sep 06, 2016
Extras: None
Dependencies:
pyasn1 (>=0.4.6)