ldaptor
A Pure-Python Twisted library for LDAP
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 on this page — 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
ldaptor on PyPI
pip
pip install ldaptoruv
uv add ldaptorpoetry
poetry add ldaptorInstalling 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 the current Python release (~=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — passlib, Twisted, pyparsing, six, zope.interface |
| Maintenance | actively maintained — 1,993 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,917,769/month — #3,432 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ldaptor-21.2.0-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
python-ldapProvides an object-oriented Python API to…
permissive · top 5,000 on PyPI
django-auth-ldapProvides a Django authentication backend that…
permissive · top 15,000 on PyPI
msldapmsldap is a Python library for querying and…
permissive · top 15,000 on PyPI
python-active-directoryAn Active Directory client library for Python…
permissive · top 15,000 on PyPI
ldap3ldap3 is a pure Python LDAP V3 client library…
copyleft · top 5,000 on PyPI
python3-ldapThis package is a redirect to ldap3—a pure…
copyleft · top 15,000 on PyPI
ldapdomaindumpCollects and exports Active Directory…
permissive · top 15,000 on PyPI
treqtreq is a high-level HTTP client library for…
permissive · top 15,000 on PyPI
TwistedTwisted is an event-driven networking framework…
permissive · top 5,000 on PyPI
txtorcontxtorcon is a client library for controlling…
permissive · top 15,000 on PyPI