tessl install tessl/pypi-ldap3@1.4.0A strictly RFC 4510 conforming LDAP V3 pure Python client library
Agent Success
Agent success rate when using this tile
81%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.08x
Baseline
Agent success rate without this tile
75%
Design a small directory search helper that demonstrates scoped searches, alias handling, and paged retrieval against an LDAP-compatible directory.
@generates
from collections.abc import Callable
from typing import Any, Iterable
class DirectorySearchClient:
def __init__(self, connection_factory: Callable[[], Any]):
"""Prepare a client that can obtain a fresh LDAP connection when needed."""
def search(
self,
base_dn: str,
filter_text: str,
attributes: Iterable[str] | None,
scope: str,
deref_aliases: str,
) -> list[dict[str, Any]]:
"""Perform one search using the requested scope (base, one-level, or subtree) and alias handling (e.g., never vs always), returning entries as dictionaries."""
def paged_search(
self,
base_dn: str,
filter_text: str,
attributes: Iterable[str] | None,
page_size: int,
) -> list[list[dict[str, Any]]]:
"""Return ordered pages of entries, following paging markers until exhaustion."""Provides LDAP connectivity, scoped searches, alias dereference controls, and paging helpers.