Skip to main content

A strictly RFC 4510 conforming LDAP V3 pure Python client library

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ldap3-2.9.tar.gz (396.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ldap3-2.9-py3.9.egg (852.8 kB view details)

Uploaded Egg

ldap3-2.9-py2.py3-none-any.whl (430.2 kB view details)

Uploaded Python 2Python 3

ldap3-2.9-py2.7.egg (854.2 kB view details)

Uploaded Egg

ldap3-2.9-py2.6.egg (855.1 kB view details)

Uploaded Egg

File details

Details for the file ldap3-2.9.tar.gz.

File metadata

  • Download URL: ldap3-2.9.tar.gz
  • Upload date:
  • Size: 396.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ldap3-2.9.tar.gz
Algorithm Hash digest
SHA256 18c3ee656a6775b9b0d60f7c6c5b094d878d1d90fc03d56731039f0a4b546a91
MD5 c2e381d2ae7a07229f0bf4946750c3ac
BLAKE2b-256 69ca38c8d3c44d89b7a6461fe83750854f94053474b1390c31dba187d2d512dd

See more details on using hashes here.

File details

Details for the file ldap3-2.9-py3.9.egg.

File metadata

  • Download URL: ldap3-2.9-py3.9.egg
  • Upload date:
  • Size: 852.8 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ldap3-2.9-py3.9.egg
Algorithm Hash digest
SHA256 8c949edbad2be8a03e719ba48bd6779f327ec156929562814b3e84ab56889c8c
MD5 fd298632a4f628bc2ec2049bab4ad4fe
BLAKE2b-256 53bce9c4836a1dead4709d71c3c0eea7ba902328aaa17dc8615e79e3123b5c16

See more details on using hashes here.

File details

Details for the file ldap3-2.9-py2.py3-none-any.whl.

File metadata

  • Download URL: ldap3-2.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 430.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ldap3-2.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c1df41d89459be6f304e0ceec4b00fdea533dbbcd83c802b1272dcdb94620b57
MD5 684ce3ff767759827c96c271776fe617
BLAKE2b-256 3ffb00547465dc9d02cc1ceab8b5700dd4aebce53759ee26c7cf8d91bf3cf3e3

See more details on using hashes here.

File details

Details for the file ldap3-2.9-py2.7.egg.

File metadata

  • Download URL: ldap3-2.9-py2.7.egg
  • Upload date:
  • Size: 854.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ldap3-2.9-py2.7.egg
Algorithm Hash digest
SHA256 afc6fc0d01f02af82cd7bfabd3bbfd5dc96a6ae91e97db0a2dab8a0f1b436056
MD5 1bf23de9e77152235f9bbe93670e2f90
BLAKE2b-256 93ee9c8d88d5992131a01300ee2adda425fa8b2a07213fba13b14a7604823ada

See more details on using hashes here.

File details

Details for the file ldap3-2.9-py2.6.egg.

File metadata

  • Download URL: ldap3-2.9-py2.6.egg
  • Upload date:
  • Size: 855.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ldap3-2.9-py2.6.egg
Algorithm Hash digest
SHA256 4139c91f0eef9782df7b77c8cbc6243086affcb6a8a249b768a9658438e5da59
MD5 42dfa585d10a9a9c515ce3acb4aa7380
BLAKE2b-256 11994806a4ff1b37703858d9883b7e7fd45ea2114a68fab1e99f3b2985c77260

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page