--- id: ldaptor version: "21.2.0" license: MIT license_treatment: permissive maintenance: active --- # ldaptor — A Pure-Python Twisted library for LDAP License: permissive · Maintenance: active · Downloads: 1.9M/mo ## What it is and what it does Ldaptor is a pure-Python LDAP client library that runs on top of Twisted, providing asynchronous access to LDAP directory services. It handles the full LDAP protocol stack—client connections, authentication, directory searches, and filter parsing—without requiring compiled C extensions. The library also includes utilities for LDIF format generation, Samba password operations, and command-line tools. You use it when you need to query or authenticate against LDAP directories from Python, particularly in applications already built on Twisted or where async I/O is desired. It parses LDAP filters from text, generates protocol messages, and manages the connection lifecycle through Twisted's deferred-based concurrency model. Dependencies are all pure-Python (Twisted, pyparsing, passlib, six, zope.interface), so installation is straightforward. Use it for: - Authenticate users against an LDAP directory in a Twisted-based web or network service. - Query LDAP directory entries (users, groups, organizational units) and export results as LDIF. - Implement Samba password changes programmatically from a Python application. - Build LDAP client tools or utilities that need to parse and generate LDAP protocol messages. - Integrate directory lookups into async Python applications without blocking the event loop. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Ldaptor is a pure-Python LDAP client library built on Twisted that handles LDAP protocol operations, filter parsing, and directory queries without compiled dependencies. Yes, if you are building on Twisted or need async LDAP operations. The library is stable (Production/Stable status), has no known vulnerabilities, and low install friction. The gap between the latest release (2021-02-28) and active repo commits (2026-05-25) suggests development may outpace PyPI releases; verify current Python version support before adopting in new projects. Suitable for established LDAP integration tasks. ## Install pip install ldaptor uv add ldaptor poetry add ldaptor ## Installing ldaptor Before you install: Low install friction; ships as a wheel. Maintenance is active with recent commits (2026-05-25), though the latest PyPI release is from 2021-02-28. Depends on Twisted and four other pure-Python libraries, all widely available. License in practice: MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects. Quickstart: pip install ldaptor from twisted.internet import reactor, defer from ldaptor.protocols.ldap import ldapclient, ldapconnector @defer.inlineCallbacks def query(): c = ldapconnector.LDAPClientCreator(reactor, ldapclient.LDAPClient) client = yield c.connect(b'dc=example,dc=com') yield client.bind(b'user@example.com', b'password') # perform search or other operations reactor.callWhenRunning(query) reactor.run() Requires Twisted reactor event loop; LDAP operations are async/deferred-based, not blocking calls. Verify before relying: - Whether the 2021-02-28 release date reflects actual maintenance lag or if PyPI metadata is stale relative to active development. - Compatibility with Python versions beyond 3.9 (classifiers list up to 3.9; current support unclear). ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags LDAP client library Python, directory authentication queries, LDAP protocol implementation, pure Python LDAP, Twisted LDAP, LDIF generation, Samba password changing, ldap-client, twisted-async, directory-auth [View on SkillFed](https://skillfed.io/packages/ldaptor) · [View on PyPI](https://pypi.org/project/ldaptor/)