Skip to main content
Codecov Read the Docs GitHub Actions PyPI Black

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

anyldap-0.1.0.tar.gz (304.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anyldap-0.1.0-py3-none-any.whl (205.1 kB view details)

Uploaded Python 3

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

Hashes for anyldap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 260b03cc9b11917c9a08e439c58b0a6c74472ec4aff3e2e9433984ff2164fa2f
MD5 d35cd843a6f3844046117e22284da285
BLAKE2b-256 b9e7beff739b2df41b10e23f851cc0f8256d619c7c3d845bacf18fad46d354c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for anyldap-0.1.0.tar.gz:

Publisher: main.yml on graingert/anyldap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for anyldap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7080e14e08d6b0631816b4d03732e2080af81fdc2fa47fd0418fbad4d3cfb149
MD5 a5b29b7fe833b9d368189122267c79b2
BLAKE2b-256 e46bf23d1395e9314b949148787bda08eca708c8f7c5f8610bfae607e6002ac3

See more details on using hashes here.

Provenance

The following attestation bundles were made for anyldap-0.1.0-py3-none-any.whl:

Publisher: main.yml on graingert/anyldap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page