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 one 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_dev-2.10.4.tar.gz (446.2 kB view details)

Uploaded Source

Built Distribution

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

ldap3_dev-2.10.4-py3-none-any.whl (482.0 kB view details)

Uploaded Python 3

File details

Details for the file ldap3_dev-2.10.4.tar.gz.

File metadata

  • Download URL: ldap3_dev-2.10.4.tar.gz
  • Upload date:
  • Size: 446.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ldap3_dev-2.10.4.tar.gz
Algorithm Hash digest
SHA256 4ad95f18eb33e0f45320a55b08ace1a9920c92c8d9c5e0d314acd92f7fbe05df
MD5 bdd7ccb4bf04dd169642f6aaf5442d0d
BLAKE2b-256 9a640f050a095b25311f1b48cedda73e23bcb4378b7d3988063c60759128adc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ldap3_dev-2.10.4.tar.gz:

Publisher: none.yml on fancybear-dev/ldap3-dev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ldap3_dev-2.10.4-py3-none-any.whl.

File metadata

  • Download URL: ldap3_dev-2.10.4-py3-none-any.whl
  • Upload date:
  • Size: 482.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ldap3_dev-2.10.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1b0b857455169626b7f960bf51b720906dcf9cda36eb932721919c0741b4e02c
MD5 1906eaf62189ac7046366d99948c49fe
BLAKE2b-256 6bbf7142dbaffd9af9d57ff5983a8e5bf802010b6e79dcbc27020eb3047ba4ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for ldap3_dev-2.10.4-py3-none-any.whl:

Publisher: none.yml on fancybear-dev/ldap3-dev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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