anyldap is a pure-Python, AnyIO-based library for Python 3.10 and newer that implements:
LDAP client and server logic
separately-accessible LDAP and BER protocol message generation/parsing
ASCII-format LDAP filter generation and parsing
LDIF format data generation
Samba password changing logic
Also included is a set of LDAP utilities for use from the command line.
The full documentation is available on Read the Docs.
Quick Usage Example
import anyio
from anyldap.protocols.ldap import ldapclient, ldapconnector, ldapsyntax
async def example():
serverip = "192.168.128.21"
basedn = b"dc=example,dc=com"
binddn = b"bjensen@example.com"
bindpw = b"secret"
query = b"(cn=Babs*)"
overrides = {basedn: (serverip, 389)}
connection = await ldapconnector.connectToLDAPDNAsync(
basedn,
ldapclient.LDAPClient,
overrides=overrides,
)
async with connection as client:
await client.bind_async(binddn, bindpw)
entry = ldapsyntax.LDAPEntry(client, basedn)
results = await entry.search_async(filterText=query)
for result in results:
print(result.getLDIF())
if __name__ == "__main__":
anyio.run(example)
Installation
Install anyldap from PyPI:
python -m pip install anyldap
To install a repository checkout in editable mode:
python -m pip install -e .
For a server example from a repo checkout, see docs/source/examples/quickstart_server.py.
Dependencies:
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anyldap-0.1.0.tar.gz.
File metadata
- Download URL: anyldap-0.1.0.tar.gz
- Upload date:
- Size: 304.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
260b03cc9b11917c9a08e439c58b0a6c74472ec4aff3e2e9433984ff2164fa2f
|
|
| MD5 |
d35cd843a6f3844046117e22284da285
|
|
| BLAKE2b-256 |
b9e7beff739b2df41b10e23f851cc0f8256d619c7c3d845bacf18fad46d354c4
|
Provenance
The following attestation bundles were made for anyldap-0.1.0.tar.gz:
Publisher:
main.yml on graingert/anyldap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anyldap-0.1.0.tar.gz -
Subject digest:
260b03cc9b11917c9a08e439c58b0a6c74472ec4aff3e2e9433984ff2164fa2f - Sigstore transparency entry: 2325675594
- Sigstore integration time:
-
Permalink:
graingert/anyldap@e2cb7a360fe3a82028d8a70193eb4729117aba10 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/graingert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@e2cb7a360fe3a82028d8a70193eb4729117aba10 -
Trigger Event:
push
-
Statement type:
File details
Details for the file anyldap-0.1.0-py3-none-any.whl.
File metadata
- Download URL: anyldap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 205.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7080e14e08d6b0631816b4d03732e2080af81fdc2fa47fd0418fbad4d3cfb149
|
|
| MD5 |
a5b29b7fe833b9d368189122267c79b2
|
|
| BLAKE2b-256 |
e46bf23d1395e9314b949148787bda08eca708c8f7c5f8610bfae607e6002ac3
|
Provenance
The following attestation bundles were made for anyldap-0.1.0-py3-none-any.whl:
Publisher:
main.yml on graingert/anyldap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anyldap-0.1.0-py3-none-any.whl -
Subject digest:
7080e14e08d6b0631816b4d03732e2080af81fdc2fa47fd0418fbad4d3cfb149 - Sigstore transparency entry: 2325675623
- Sigstore integration time:
-
Permalink:
graingert/anyldap@e2cb7a360fe3a82028d8a70193eb4729117aba10 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/graingert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@e2cb7a360fe3a82028d8a70193eb4729117aba10 -
Trigger Event:
push
-
Statement type: