--- id: python-ldap version: "3.4.7" license: python-ldap license_treatment: permissive maintenance: active --- # python-ldap — Python modules for implementing LDAP clients License: permissive · Maintenance: active · Downloads: 4.4M/mo ## What it is and what it does python-ldap is a wrapper around OpenLDAP client libraries that exposes LDAP directory operations through Python objects. It lets you connect to LDAP servers, authenticate users, search directory entries, and process LDAP-related data formats like LDIF and schema definitions. The package is built on compiled C extensions, so it depends on system-level OpenLDAP libraries being present. The library is used primarily for authentication and directory lookups in enterprise environments. It handles the low-level protocol details and connection management, letting you focus on directory queries and user management logic. Runtime dependencies are pyasn1 and pyasn1_modules for ASN.1 encoding, but the installation itself requires C compilation and OpenLDAP headers. Use it for: - Authenticate users against an LDAP server in a web application or service. - Search and retrieve user or group information from a directory for provisioning workflows. - Process LDIF files for directory data import or export. - Validate LDAP schema and parse LDAPv3 controls and extended operations. - Build directory-aware applications that need to query organizational structure or user attributes. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides an object-oriented Python API to connect to and query LDAP directory servers, wrapping OpenLDAP client libraries and offering utilities for LDIF processing, LDAP URLs, and schema handling. Yes, if you need LDAP directory integration and can meet the system dependency requirements. The package is stable, actively maintained, has no known vulnerabilities, and is widely used in enterprise Python applications. The main barrier is high install friction—you must have OpenLDAP development libraries available on your system. If you're working with corporate LDAP servers, this is the standard choice; if you don't need LDAP, the system dependency overhead makes it not worth installing. ## Install pip install python-ldap uv add python-ldap poetry add python-ldap ## Installing python-ldap Before you install: High install friction due to compiled C extension wrapping OpenLDAP libraries; requires system-level LDAP development headers. Maintenance is active with recent releases and no known vulnerabilities. License in practice: Licensed under a permissive Python-style license; contributions since July 2021 are under MIT. License text preservation is required but imposes minimal restrictions on use or distribution. Quickstart: import ldap l = ldap.initialize("ldap://my_ldap_server.my_domain") l.simple_bind_s("", "") l.search_s("o=My Organisation, c=AU", ldap.SCOPE_SUBTREE, "objectclass=*") Requires OpenLDAP client libraries and development headers installed on the system; not a pure-Python package. Verify before relying: - Whether the package's C extension compiles cleanly on all supported platforms. - Performance characteristics and scalability limits for large directory queries. - Current state of SASL support and any known limitations with modern LDAP servers. ## Package facts - License: python-ldap (permissive) - Python support: supports_current - Install friction: high - Maintenance: active - Downloads: 4.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags ldap client library python, directory server authentication, ldap query and bind, user lookup directory, ldap schema processing, directory services api, ldap data interchange format, ldap-client, directory-services, authentication [View on SkillFed](https://skillfed.io/packages/python-ldap) · [View on PyPI](https://pypi.org/project/python-ldap/)