ldap3
A strictly RFC 4510 conforming LDAP V3 pure Python client library
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
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 · maintenance · safety
LGPL v3 (copyleft) — 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.
last release 2021-07-18 (1853 days) · last repo commit 2026-04-18 · 937 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 18,857,053 downloads/mo, #1,076 on PyPI
Alternatives
Verify before relying
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=*)')- 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
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 on this page. Verify before relying on it.
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
ldap3 on PyPI
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 | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepyasn1 |
| Maintenance | Actively maintained 1,853 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 18,857,053 / month, #1,076 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)Operating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Systems Administration :: Authentication/Directory :: LDAP |
Evidence: ldap3-2.9.1-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “ldap client library python”
- ldap3ldap3 is a pure Python LDAP V3 client library that implements RFC…
- ldaptorLdaptor is a pure-Python LDAP client library built on Twisted that…
- python3-ldapThis package is a redirect to ldap3—a pure Python LDAP V3 client…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also python3-ldap · types-ldap3 · python-active-directory · python-ldap · ldapdomaindump · ldaptor · msldap · django-auth-ldap · python-freeipa · qh3