A strictly RFC 4510 conforming LDAP V3 pure Python client library
81
A utility that performs a directory search and exposes results both as structured data and as serialized JSON/LDIF for reuse.
json_path is provided. @testldif_path is provided. @test@generates
from dataclasses import dataclass
from typing import Any, Iterable, Optional
@dataclass
class SearchRequest:
server_uri: str
base_dn: str
search_filter: str
attributes: Optional[Iterable[str]] = None
bind_dn: Optional[str] = None
password: Optional[str] = None
json_path: Optional[str] = None
ldif_path: Optional[str] = None
@dataclass
class ExportResult:
entries: list[Any]
raw_response: list[Any]
json_text: str
ldif_text: str
json_file: Optional[str]
ldif_file: Optional[str]
def export_search(request: SearchRequest) -> ExportResult:
"""
Perform the directory search with the provided parameters, returning collected entries,
raw response data, serialized JSON/LDIF strings, and any file paths written.
"""Use this package to connect to the directory, execute the search, access entries/responses, and serialize results to JSON and LDIF. @satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-ldap3evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10