--- id: ldap3 version: "2.9.1" license: LGPL v3 license_treatment: copyleft maintenance: active --- # ldap3 — A strictly RFC 4510 conforming LDAP V3 pure Python client library License: copyleft · Maintenance: active · Downloads: 18.9M/mo ## What it is and what it does ldap3 is a pure Python LDAP V3 client that runs on Python 2, Python 3, PyPy, and PyPy3. It provides RFC 4510-conforming LDAP operations with both a low-level API for direct LDAP commands and a higher-level Abstraction Layer for more pythonic directory interactions. The library includes thread-safe connection strategies (SAFE_SYNC, SAFE_RESTARTABLE, and ASYNC) to handle multithreaded scenarios, each returning a tuple of status, result, response, and request. The package depends only on pyasn1 for ASN.1 encoding/decoding and installs with minimal friction. It is designed for applications that need to authenticate users, query directory services, or perform LDAP operations against Active Directory, OpenLDAP, or other LDAP-compliant servers. The Abstraction Layer abstracts away the complexity of raw LDAP protocol details, making directory operations more accessible to Python developers. Use it for: - Authenticate users against Active Directory or OpenLDAP in web applications or services - Query LDAP directory servers to retrieve user attributes, group memberships, or organizational structure - Build user provisioning or account management tools that interact with enterprise directory services - Implement single sign-on (SSO) systems that validate credentials against LDAP backends - Automate directory operations in multithreaded applications using SAFE_SYNC or ASYNC strategies ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. ldap3 is a pure Python LDAP V3 client library that implements RFC 4510, providing both low-level LDAP operations and a high-level abstraction layer for directory queries and authentication. Yes. ldap3 is a stable, actively maintained library with no known vulnerabilities, low install friction, and broad Python version support. It is the standard choice for LDAP operations in Python. The LGPL v3 license requires disclosure but permits use in proprietary applications. Install it if you need to authenticate against or query LDAP directories. ## Install pip install ldap3 uv add ldap3 poetry add ldap3 ## Installing ldap3 Before you install: Low install friction with a single pure-Python runtime dependency (pyasn1). The package is actively maintained as of 2026-04-18 with no known vulnerabilities, though the latest release is from 2021-07-18. License in practice: Released under LGPL v3 (copyleft). Any derivative work or modification must be released under the same license; proprietary applications can use it as a library but must disclose the license terms. Quickstart: pip install ldap3 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=*)') Verify before relying: - Whether the Abstract Layer is thread-safe in current versions (description notes it is NOT thread safe as of documentation time) - Current maintenance status beyond the 2026-04-18 last commit date and whether Python 2 support is still active ## Package facts - License: LGPL v3 (copyleft) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 18.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags ldap client library python, active directory authentication, ldap directory search, rfc 4510 ldap, python ldap operations, ldap user authentication, directory services client, ldap, authentication, directory-services [View on SkillFed](https://skillfed.io/packages/ldap3) · [View on PyPI](https://pypi.org/project/ldap3/)